[Intel-gfx] [PATCH v2 2/6] drm/i915: Only pin the fence for primary planes (and gen2/3)

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 21 21:53:22 UTC 2018


Quoting Ville Syrjala (2018-02-21 18:48:07)
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Currently we pin a fence on every plane doing tiled scanout. The
> number of planes we have available is fast apporaching the number
> of fences so we really should stop wasting them. Only FBC needs
> the fence on gen4+, so let's use fences only for the primary planes
> on those platforms.
> 
> v2: drop the tiling check from plane_uses_fence() as the obj is
>     NULL during initial_plane_config() and we don't rally need the
>     check since i915_vma_pin_fence() does the check anyway
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 14 +++++++++++++-
>  drivers/gpu/drm/i915/intel_drv.h     |  1 +
>  drivers/gpu/drm/i915/intel_fbdev.c   |  2 +-
>  3 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 66b269bc24b9..f2c1bb715e7b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2067,9 +2067,18 @@ static unsigned int intel_surf_alignment(const struct drm_framebuffer *fb,
>         }
>  }
>  
> +static bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
> +{
> +       struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
> +       struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> +
> +       return INTEL_GEN(dev_priv) < 4 || plane->id == PLANE_PRIMARY;
> +}
> +
>  struct i915_vma *
>  intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
>                            unsigned int rotation,
> +                          bool uses_fence,

(Before long you'll have more than one bool :)

>                            unsigned long *out_flags)
>  {
>         struct drm_device *dev = fb->dev;
> @@ -2122,7 +2131,7 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb,
>         if (IS_ERR(vma))
>                 goto err;
>  
> -       if (i915_vma_is_map_and_fenceable(vma)) {
> +       if (uses_fence && i915_vma_is_map_and_fenceable(vma)) {

Ok.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list