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

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

 



Op 07-01-18 om 10:59 schreef Vidya Srinivas:
> From: Chandra Konduru <chandra.konduru@xxxxxxxxx>
>
> This patch adds NV12 to list of supported formats for
> primary plane
>
> v2: Rebased (Chandra Konduru)
>
> v3: Rebased (me)
>
> v4: Review comments by Ville addressed
> Removed the skl_primary_formats_with_nv12 and
> added NV12 case in existing skl_primary_formats
>
> v5: Rebased (me)
>
> v6: Missed the Tested-by/Reviewed-by in the previous series
> Adding the same to commit message in this version.
>
> v7: Review comments by Ville addressed
> 	Restricting the NV12 for BXT and on PIPE A and B
> Rebased (me)
>
> v8: Rebased (me)
> Modified restricting the NV12 support for both BXT and KBL.
>
> v9: Rebased (me)
>
> Tested-by: Clinton Taylor <clinton.a.taylor@xxxxxxxxx>
> Reviewed-by: Clinton Taylor <clinton.a.taylor@xxxxxxxxx>
> Signed-off-by: Chandra Konduru <chandra.konduru@xxxxxxxxx>
> Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@xxxxxxxxx>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 26 ++++++++++++++++++++++++--
>  1 file changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index d05890b..4b92e41 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -106,6 +106,22 @@ static const uint64_t skl_format_modifiers_ccs[] = {
>  	DRM_FORMAT_MOD_INVALID
>  };
>  
> +static const uint32_t nv12_primary_formats[] = {
> +	DRM_FORMAT_C8,
> +	DRM_FORMAT_RGB565,
> +	DRM_FORMAT_XRGB8888,
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ARGB8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_YUYV,
> +	DRM_FORMAT_YVYU,
> +	DRM_FORMAT_UYVY,
> +	DRM_FORMAT_VYUY,
> +	DRM_FORMAT_NV12,
> +};
> +
>  /* Cursor formats */
>  static const uint32_t intel_cursor_formats[] = {
>  	DRM_FORMAT_ARGB8888,
> @@ -13180,8 +13196,14 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
>  		primary->disable_plane = skl_disable_plane;
>  		primary->get_hw_state = skl_plane_get_hw_state;
>  	} else if (INTEL_GEN(dev_priv) >= 9) {
> -		intel_primary_formats = skl_primary_formats;
> -		num_formats = ARRAY_SIZE(skl_primary_formats);
> +		if ((IS_BROXTON(dev_priv) || IS_KABYLAKE(dev_priv)) &&
> +			((pipe == PIPE_A || pipe == PIPE_B))) {
> +			intel_primary_formats = nv12_primary_formats;
> +			num_formats = ARRAY_SIZE(nv12_primary_formats);
> +		} else {
> +			intel_primary_formats = skl_primary_formats;
> +			num_formats = ARRAY_SIZE(skl_primary_formats);
> +		}
Both format arrays are nearly the same and could probably end up being a source of bugs, could DRM_FORMAT_NV12 be added to skl_primary_formats, with a comment it should be the last member, and decrease num_formats by 1 if NV12 is not supported? And what about gen10+, shouldn't that also have nv12 support?

~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://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