[Intel-gfx] [PATCH 2/4] drm/i915: Introduce a vfunc for platform-specfic MMIO flip code
Daniel Vetter
daniel at ffwll.ch
Mon Oct 27 10:16:06 CET 2014
On Sat, Oct 25, 2014 at 12:11:12AM +0100, Damien Lespiau wrote:
> SKL will specialize it.
>
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
So with atomic I'd expect that we'd have one giant mmio_flip driver
function and that just calls into the relevant platform/plane update
hooks. Gustavo&Ville are working on that monster.
Now this here seems to add another incarnation. Can't I have just one
please?
Thanks, Daniel
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> drivers/gpu/drm/i915/intel_display.c | 17 +++++++++++++----
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 627b7e7..d979549 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -492,6 +492,7 @@ struct drm_i915_display_funcs {
> struct drm_i915_gem_object *obj,
> struct intel_engine_cs *ring,
> uint32_t flags);
> + void (*do_mmio_flip)(struct intel_crtc *crtc);
> void (*update_primary_plane)(struct drm_crtc *crtc,
> struct drm_framebuffer *fb,
> int x, int y);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5133ef9..07440ad 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9552,7 +9552,7 @@ static bool use_mmio_flip(struct intel_engine_cs *ring,
> return ring != obj->ring;
> }
>
> -static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
> +static void ilk_do_mmio_flip(struct intel_crtc *intel_crtc)
> {
> struct drm_device *dev = intel_crtc->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -9561,9 +9561,6 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
> struct drm_i915_gem_object *obj = intel_fb->obj;
> u32 dspcntr;
> u32 reg;
> -
> - intel_mark_page_flip_active(intel_crtc);
> -
> reg = DSPCNTR(intel_crtc->plane);
> dspcntr = I915_READ(reg);
>
> @@ -9579,6 +9576,15 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
> POSTING_READ(DSPSURF(intel_crtc->plane));
> }
>
> +static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
> +{
> + struct drm_device *dev = intel_crtc->base.dev;
> + struct drm_i915_private *dev_priv = dev->dev_private;
> +
> + intel_mark_page_flip_active(intel_crtc);
> + dev_priv->display.do_mmio_flip(intel_crtc);
> +}
> +
> static int intel_postpone_flip(struct drm_i915_gem_object *obj)
> {
> struct intel_engine_cs *ring;
> @@ -12694,6 +12700,9 @@ static void intel_init_display(struct drm_device *dev)
> break;
> }
>
> + if (INTEL_INFO(dev)->gen >= 5)
> + dev_priv->display.do_mmio_flip = ilk_do_mmio_flip;
> +
> intel_panel_init_backlight_funcs(dev);
>
> mutex_init(&dev_priv->pps_mutex);
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the Intel-gfx
mailing list