Re: [PATCH 06/11] drm/i915: Add NV12 as supported format for primary plane

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 30, 2015 at 08:43:10PM -0700, Chandra Konduru wrote:
> This patch adds NV12 to list of supported formats for
> primary plane.
> 
> Signed-off-by: Chandra Konduru <chandra.konduru@xxxxxxxxx>
> Testcase: igt/kms_nv12
> ---
>  drivers/gpu/drm/i915/intel_display.c |   32 +++++++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c235a66..d3773d2 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -59,7 +59,7 @@ static const uint32_t intel_primary_formats_gen2[] = {
>  	DRM_FORMAT_ARGB1555,
>  };
>  
> -/* Primary plane formats for gen >= 4 */
> +/* Primary plane formats for gen 4 to 8 */
>  static const uint32_t intel_primary_formats_gen4[] = {
>  	COMMON_PRIMARY_FORMATS, \
>  	DRM_FORMAT_XBGR8888,
> @@ -70,6 +70,28 @@ static const uint32_t intel_primary_formats_gen4[] = {
>  	DRM_FORMAT_ABGR2101010,
>  };
>  
> +/* Primary plane formats for gen >= 9 */
> +static const uint32_t intel_primary_formats_gen9[] = {
> +	COMMON_PRIMARY_FORMATS, \
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_ARGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_ABGR2101010,
> +};
> +
> +static const uint32_t intel_primary_formats_with_nv12_gen9[] = {
> +	COMMON_PRIMARY_FORMATS, \
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_ARGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_ABGR2101010,
> +	DRM_FORMAT_NV12,
> +};

This duplication is a bit unpretty, and we already started to share code
with skl sprites to prep for the great unification of plane code for
gen9+. Can you please do the same with these tables? I also like the names
in intel_sprite.c more. Follow-up patch or squashed in both ok.
-Daniel

> +
>  /* Cursor formats */
>  static const uint32_t intel_cursor_formats[] = {
>  	DRM_FORMAT_ARGB8888,
> @@ -13204,6 +13226,14 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,
>  	if (INTEL_INFO(dev)->gen <= 3) {
>  		intel_primary_formats = intel_primary_formats_gen2;
>  		num_formats = ARRAY_SIZE(intel_primary_formats_gen2);
> +	} else if (INTEL_INFO(dev)->gen >= 9) {
> +		if (pipe == PIPE_A || pipe == PIPE_B) {
> +			intel_primary_formats = intel_primary_formats_with_nv12_gen9;
> +			num_formats = ARRAY_SIZE(intel_primary_formats_with_nv12_gen9);
> +		} else {
> +			intel_primary_formats = intel_primary_formats_gen9;
> +			num_formats = ARRAY_SIZE(intel_primary_formats_gen9);
> +		}
>  	} else {
>  		intel_primary_formats = intel_primary_formats_gen4;
>  		num_formats = ARRAY_SIZE(intel_primary_formats_gen4);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux