[Intel-gfx] [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
Chris Wilson
chris at chris-wilson.co.uk
Tue Jan 23 21:11:23 UTC 2018
Quoting Ville Syrjala (2018-01-23 18:33:43)
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Replace the ad-hoc plane indexing scheme used by the frontbuffer
> tracking with enum plane_id.
>
> The old video overlay not being part of the plane_id namespace
> will just be given the high bit.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 11 +++--------
> drivers/gpu/drm/i915/intel_display.c | 4 ++--
> drivers/gpu/drm/i915/intel_fbc.c | 2 +-
> drivers/gpu/drm/i915/intel_sprite.c | 4 +++-
> 4 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8333692dac5a..bd545b1c9546 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
> *
> * We have one bit per pipe and per scanout plane type.
> */
> -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
I would feel safer with a BUILD_BUG_ON to catch plane_id overflowing
INTEL_FRONTBUFFER_BITS_PER_PIPE (-1 for the overlay reservation).
> -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> - (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> - (1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> - (1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> + (1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> - (1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> + (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
> (0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
The conversion looks straightforward nevertheless, and indeed no reason
to have move than one indexing id for a plane.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
More information about the Intel-gfx
mailing list