Skip to content

Commit

Permalink
drm/vc4: Add a mode for using the closed firmware for display.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Anholt <eric@anholt.net>
  • Loading branch information
anholt authored and popcornmix committed May 10, 2017
1 parent f84a32f commit 6b1dfcb
Show file tree
Hide file tree
Showing 5 changed files with 682 additions and 0 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_drv.o \
vc4_dpi.o \
vc4_dsi.o \
vc4_firmware_kms.o \
vc4_kms.o \
vc4_gem.o \
vc4_hdmi.o \
Expand Down
13 changes: 13 additions & 0 deletions drivers/gpu/drm/vc4/vc4_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id,
int vblank_lines;
int ret = 0;

if (vc4->firmware_kms)
return 0;

/* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */

/* Get optional system timestamp before query. */
Expand Down Expand Up @@ -659,6 +662,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id)
struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id);
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);

if (vc4->firmware_kms) {
/* XXX: Can we mask the SMI interrupt? */
return 0;
}

CRTC_WRITE(PV_INTEN, PV_INT_VFP_START);

return 0;
Expand All @@ -669,6 +677,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id)
struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id);
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);

if (vc4->firmware_kms) {
/* XXX: Can we mask the SMI interrupt? */
return;
}

CRTC_WRITE(PV_INTEN, 0);
}

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ static struct platform_driver *const component_drivers[] = {
&vc4_dsi_driver,
&vc4_hvs_driver,
&vc4_crtc_driver,
&vc4_firmware_kms_driver,
&vc4_v3d_driver,
};

Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/vc4/vc4_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
struct vc4_dev {
struct drm_device *dev;

bool firmware_kms;
struct rpi_firmware *firmware;

struct vc4_hdmi *hdmi;
struct vc4_hvs *hvs;
struct vc4_v3d *v3d;
Expand Down Expand Up @@ -470,6 +473,10 @@ int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused);
extern struct platform_driver vc4_dsi_driver;
int vc4_dsi_debugfs_regs(struct seq_file *m, void *unused);

/* vc4_firmware_kms.c */
extern struct platform_driver vc4_firmware_kms_driver;
void vc4_fkms_cancel_page_flip(struct drm_crtc *crtc, struct drm_file *file);

/* vc4_gem.c */
void vc4_gem_init(struct drm_device *dev);
void vc4_gem_destroy(struct drm_device *dev);
Expand Down
Loading

0 comments on commit 6b1dfcb

Please sign in to comment.