Skip to content

Commit

Permalink
drm/vc4: Add firmware-kms mode
Browse files Browse the repository at this point in the history
This is a squash of all firmware-kms related patches from previous
branches, up to and including
"drm/vc4: Set the possible crtcs mask correctly for planes with FKMS"
plus a couple of minor fixups for the 5.9 branch.
Please refer to earlier branches for full history.

This patch includes work by Eric Anholt, James Hughes, Phil Elwell,
Dave Stevenson, Dom Cobley, and Jonathon Bell.

Signed-off-by: Dave Stevenson <[email protected]>

drm/vc4: Fixup firmware-kms after "drm/atomic: Pass the full state to CRTC atomic enable/disable"

Prototype for those calls changed, so amend fkms (which isn't
upstream) to match.

Signed-off-by: Dave Stevenson <[email protected]>

drm/vc4: Fixup fkms for API change

Atomic flush and check changed API, so fix up the downstream-only
FKMS driver.

Signed-off-by: Dave Stevenson <[email protected]>

drm/vc4: Make normalize_zpos conditional on using fkms

Eric's view was that there was no point in having zpos
support on vc4 as all the planes had the same functionality.

Can be later squashed into (and fixes):
drm/vc4: Add firmware-kms mode

Signed-off-by: Dom Cobley <[email protected]>

drm/vc4: FKMS: Change of Broadcast RGB mode needs a mode change

The Broadcast RGB (aka HDMI limited/full range) property is only
notified to the firmware on mode change, so this needs to be
signalled when set.

raspberrypi/firmware#1580

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 authored and popcornmix committed Jul 21, 2021
1 parent 6769990 commit 5a97216
Show file tree
Hide file tree
Showing 7 changed files with 2,221 additions and 12 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vc4-y := \
vc4_dpi.o \
vc4_dsi.o \
vc4_fence.o \
vc4_firmware_kms.o \
vc4_kms.o \
vc4_gem.o \
vc4_hdmi.o \
Expand Down
15 changes: 10 additions & 5 deletions drivers/gpu/drm/vc4/vc4_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,22 @@ static int vc4_drm_bind(struct device *dev)
if (ret)
return ret;

ret = vc4_plane_create_additional_planes(drm);
if (ret)
goto unbind_all;
if (!vc4->firmware_kms) {
ret = vc4_plane_create_additional_planes(drm);
if (ret)
goto unbind_all;
}

drm_fb_helper_remove_conflicting_framebuffers(NULL, "vc4drmfb", false);

ret = vc4_kms_load(drm);
if (ret < 0)
goto unbind_all;

drm_for_each_crtc(crtc, drm)
vc4_crtc_disable_at_boot(crtc);
if (!vc4->firmware_kms) {
drm_for_each_crtc(crtc, drm)
vc4_crtc_disable_at_boot(crtc);
}

ret = drm_dev_register(drm, 0);
if (ret < 0)
Expand Down Expand Up @@ -329,6 +333,7 @@ static struct platform_driver *const component_drivers[] = {
&vc4_hvs_driver,
&vc4_txp_driver,
&vc4_crtc_driver,
&vc4_firmware_kms_driver,
&vc4_v3d_driver,
};

Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/vc4/vc4_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ struct vc4_perfmon {
struct vc4_dev {
struct drm_device base;

bool firmware_kms;
struct rpi_firmware *firmware;

struct vc4_hdmi *hdmi;
struct vc4_hvs *hvs;
struct vc4_v3d *v3d;
struct vc4_dpi *dpi;
struct vc4_vec *vec;
struct vc4_txp *txp;
struct vc4_fkms *fkms;

struct vc4_hang_state *hang_state;

Expand Down Expand Up @@ -865,6 +870,9 @@ extern struct platform_driver vc4_dsi_driver;
/* vc4_fence.c */
extern const struct dma_fence_ops vc4_fence_ops;

/* vc4_firmware_kms.c */
extern struct platform_driver vc4_firmware_kms_driver;

/* vc4_gem.c */
int vc4_gem_init(struct drm_device *dev);
int vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
Expand Down
Loading

0 comments on commit 5a97216

Please sign in to comment.