diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2016-02-04 10:15:10 +0100 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-03-01 08:33:40 +0100 |
commit | 0bfc2b3d01feaedff65c27a36eab0d428190947d (patch) | |
tree | ee77f61606fc3efaa42e1f49679b5d768d2c5916 /drivers/gpu/drm/imx | |
parent | f5dca1608bc724236dd951d23420283cf59486e4 (diff) | |
download | linux-0bfc2b3d01feaedff65c27a36eab0d428190947d.tar.bz2 |
drm/imx: track flip state explicitly
Start tracking the flip state explicitly, as opposed to inferring
it from the presence if a new FB. This is a preparatory step to
introduce an new immediate state, where we can wait for a fence to
signal.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r-- | drivers/gpu/drm/imx/ipuv3-crtc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 319457416042..50ccc08abec7 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -31,6 +31,11 @@ #define DRIVER_DESC "i.MX IPUv3 Graphics" +enum ipu_flip_status { + IPU_FLIP_NONE, + IPU_FLIP_PENDING, +}; + struct ipu_crtc { struct device *dev; struct drm_crtc base; @@ -42,8 +47,8 @@ struct ipu_crtc { struct ipu_dc *dc; struct ipu_di *di; int enabled; + enum ipu_flip_status flip_state; struct drm_pending_vblank_event *page_flip_event; - struct drm_framebuffer *newfb; int irq; u32 bus_format; int di_hsync_pin; @@ -110,7 +115,7 @@ static int ipu_page_flip(struct drm_crtc *crtc, struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); int ret; - if (ipu_crtc->newfb) + if (ipu_crtc->flip_state != IPU_FLIP_NONE) return -EBUSY; ret = imx_drm_crtc_vblank_get(ipu_crtc->imx_crtc); @@ -121,8 +126,8 @@ static int ipu_page_flip(struct drm_crtc *crtc, return ret; } - ipu_crtc->newfb = fb; ipu_crtc->page_flip_event = event; + ipu_crtc->flip_state = IPU_FLIP_PENDING; return 0; } @@ -224,13 +229,13 @@ static irqreturn_t ipu_irq_handler(int irq, void *dev_id) imx_drm_handle_vblank(ipu_crtc->imx_crtc); - if (ipu_crtc->newfb) { + if (ipu_crtc->flip_state == IPU_FLIP_PENDING) { struct ipu_plane *plane = ipu_crtc->plane[0]; - ipu_crtc->newfb = NULL; ipu_plane_set_base(plane, ipu_crtc->base.primary->fb, plane->x, plane->y); ipu_crtc_handle_pageflip(ipu_crtc); + ipu_crtc->flip_state = IPU_FLIP_NONE; } return IRQ_HANDLED; |