diff mbox series

[v2,3/4] drm/rockchip: fix the plane format defination of rk3568/6

Message ID 20231013122112.1594259-1-andyshrk@163.com (mailing list archive)
State New, archived
Headers show
Series Some cleanup of vop2 driver | expand

Commit Message

Andy Yan Oct. 13, 2023, 12:21 p.m. UTC
From: Andy Yan <andy.yan@rock-chips.com>

Add the missing 10 bit RGB format for cluster window.
The cluster windows on rk3568/6 only support afbc format,
so change the  linear yuv format NV12/16/24 to non-Linear
YUV420_8BIT/YUV420_10BIT/YUYV/Y210.

Add NV15 for esmart windows.

Also add some comments.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

Changes in v2:
- split rename to another patch

 drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 22 +++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)

Comments

Jonas Karlman Oct. 14, 2023, 6:30 p.m. UTC | #1
Hi Andy,

On 2023-10-13 14:21, Andy Yan wrote:
> From: Andy Yan <andy.yan@rock-chips.com>
> 
> Add the missing 10 bit RGB format for cluster window.
> The cluster windows on rk3568/6 only support afbc format,
> so change the  linear yuv format NV12/16/24 to non-Linear
> YUV420_8BIT/YUV420_10BIT/YUYV/Y210.
> 
> Add NV15 for esmart windows.
> 
> Also add some comments.
> 
> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
> 
> ---
> 
> Changes in v2:
> - split rename to another patch
> 
>  drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 22 +++++++++++++-------
>  1 file changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> index 62b573f282a7..05aee588e8c9 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
> @@ -16,6 +16,10 @@
>  #include "rockchip_drm_vop2.h"
>  
>  static const uint32_t formats_win_full_10bit[] = {
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_ARGB2101010,
> +	DRM_FORMAT_XBGR2101010,
> +	DRM_FORMAT_ABGR2101010,

atomic_check() will fail for these formats due to missing support for
these formats in the vop2 driver. Support for these formats should be
added to vop2 driver before being exposed as a supported pixel format.

vop2_convert_format() return -EINVAL for these and below formats.

>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XBGR8888,
> @@ -24,9 +28,10 @@ static const uint32_t formats_win_full_10bit[] = {
>  	DRM_FORMAT_BGR888,
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_BGR565,
> -	DRM_FORMAT_NV12,
> -	DRM_FORMAT_NV16,
> -	DRM_FORMAT_NV24,
> +	DRM_FORMAT_YUV420_8BIT, /* yuv420_8bit non-Linear mode only */
> +	DRM_FORMAT_YUV420_10BIT, /* yuv420_10bit non-Linear mode only */

Same for YUV420_8BIT and YUV420_10BIT.

> +	DRM_FORMAT_YUYV, /* yuv422_8bit non-Linear mode only*/
> +	DRM_FORMAT_Y210, /* yuv422_10bit non-Linear mode only */

Same for Y210.

>  };
>  
>  static const uint32_t formats_win_full_10bit_yuyv[] = {
> @@ -38,11 +43,12 @@ static const uint32_t formats_win_full_10bit_yuyv[] = {
>  	DRM_FORMAT_BGR888,
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_BGR565,
> -	DRM_FORMAT_NV12,
> -	DRM_FORMAT_NV16,
> -	DRM_FORMAT_NV24,
> -	DRM_FORMAT_YVYU,
> -	DRM_FORMAT_VYUY,
> +	DRM_FORMAT_NV12, /* yuv420_8bit linear mode, 2 plane */
> +	DRM_FORMAT_NV15, /* yuv420_10bit linear mode, 2 plane, no padding */

Same for NV15.

Regards,
Jonas

> +	DRM_FORMAT_NV16, /* yuv422_8bit linear mode, 2 plane */
> +	DRM_FORMAT_NV24, /* yuv444_8bit linear mode, 2 plane */
> +	DRM_FORMAT_YVYU, /* yuv422_8bit[YVYU] linear mode */
> +	DRM_FORMAT_VYUY, /* yuv422_8bit[VYUY] linear mode */
>  };
>  
>  static const uint32_t formats_win_lite[] = {
Andy Yan Oct. 18, 2023, 9:48 a.m. UTC | #2
Hi Jonas:

On 10/15/23 02:30, Jonas Karlman wrote:
> Hi Andy,
>
> On 2023-10-13 14:21, Andy Yan wrote:
>> From: Andy Yan <andy.yan@rock-chips.com>
>>
>> Add the missing 10 bit RGB format for cluster window.
>> The cluster windows on rk3568/6 only support afbc format,
>> so change the  linear yuv format NV12/16/24 to non-Linear
>> YUV420_8BIT/YUV420_10BIT/YUYV/Y210.
>>
>> Add NV15 for esmart windows.
>>
>> Also add some comments.
>>
>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>
>> ---
>>
>> Changes in v2:
>> - split rename to another patch
>>
>>   drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 22 +++++++++++++-------
>>   1 file changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
>> index 62b573f282a7..05aee588e8c9 100644
>> --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
>> +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
>> @@ -16,6 +16,10 @@
>>   #include "rockchip_drm_vop2.h"
>>   
>>   static const uint32_t formats_win_full_10bit[] = {
>> +	DRM_FORMAT_XRGB2101010,
>> +	DRM_FORMAT_ARGB2101010,
>> +	DRM_FORMAT_XBGR2101010,
>> +	DRM_FORMAT_ABGR2101010,
> atomic_check() will fail for these formats due to missing support for
> these formats in the vop2 driver. Support for these formats should be
> added to vop2 driver before being exposed as a supported pixel format.
>
> vop2_convert_format() return -EINVAL for these and below formats.


Thanks for catching this, I fixed it in v3, Add have  all the added  
afbc format  tested on my rk3566-box-demo board.

>
>>   	DRM_FORMAT_XRGB8888,
>>   	DRM_FORMAT_ARGB8888,
>>   	DRM_FORMAT_XBGR8888,
>> @@ -24,9 +28,10 @@ static const uint32_t formats_win_full_10bit[] = {
>>   	DRM_FORMAT_BGR888,
>>   	DRM_FORMAT_RGB565,
>>   	DRM_FORMAT_BGR565,
>> -	DRM_FORMAT_NV12,
>> -	DRM_FORMAT_NV16,
>> -	DRM_FORMAT_NV24,
>> +	DRM_FORMAT_YUV420_8BIT, /* yuv420_8bit non-Linear mode only */
>> +	DRM_FORMAT_YUV420_10BIT, /* yuv420_10bit non-Linear mode only */
> Same for YUV420_8BIT and YUV420_10BIT.
>
>> +	DRM_FORMAT_YUYV, /* yuv422_8bit non-Linear mode only*/
>> +	DRM_FORMAT_Y210, /* yuv422_10bit non-Linear mode only */
> Same for Y210.
>
>>   };
>>   
>>   static const uint32_t formats_win_full_10bit_yuyv[] = {
>> @@ -38,11 +43,12 @@ static const uint32_t formats_win_full_10bit_yuyv[] = {
>>   	DRM_FORMAT_BGR888,
>>   	DRM_FORMAT_RGB565,
>>   	DRM_FORMAT_BGR565,
>> -	DRM_FORMAT_NV12,
>> -	DRM_FORMAT_NV16,
>> -	DRM_FORMAT_NV24,
>> -	DRM_FORMAT_YVYU,
>> -	DRM_FORMAT_VYUY,
>> +	DRM_FORMAT_NV12, /* yuv420_8bit linear mode, 2 plane */
>> +	DRM_FORMAT_NV15, /* yuv420_10bit linear mode, 2 plane, no padding */
> Same for NV15.
>
> Regards,
> Jonas
>
>> +	DRM_FORMAT_NV16, /* yuv422_8bit linear mode, 2 plane */
>> +	DRM_FORMAT_NV24, /* yuv444_8bit linear mode, 2 plane */
>> +	DRM_FORMAT_YVYU, /* yuv422_8bit[YVYU] linear mode */
>> +	DRM_FORMAT_VYUY, /* yuv422_8bit[VYUY] linear mode */
>>   };
>>   
>>   static const uint32_t formats_win_lite[] = {
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
index 62b573f282a7..05aee588e8c9 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
@@ -16,6 +16,10 @@ 
 #include "rockchip_drm_vop2.h"
 
 static const uint32_t formats_win_full_10bit[] = {
+	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_ARGB2101010,
+	DRM_FORMAT_XBGR2101010,
+	DRM_FORMAT_ABGR2101010,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XBGR8888,
@@ -24,9 +28,10 @@  static const uint32_t formats_win_full_10bit[] = {
 	DRM_FORMAT_BGR888,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_BGR565,
-	DRM_FORMAT_NV12,
-	DRM_FORMAT_NV16,
-	DRM_FORMAT_NV24,
+	DRM_FORMAT_YUV420_8BIT, /* yuv420_8bit non-Linear mode only */
+	DRM_FORMAT_YUV420_10BIT, /* yuv420_10bit non-Linear mode only */
+	DRM_FORMAT_YUYV, /* yuv422_8bit non-Linear mode only*/
+	DRM_FORMAT_Y210, /* yuv422_10bit non-Linear mode only */
 };
 
 static const uint32_t formats_win_full_10bit_yuyv[] = {
@@ -38,11 +43,12 @@  static const uint32_t formats_win_full_10bit_yuyv[] = {
 	DRM_FORMAT_BGR888,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_BGR565,
-	DRM_FORMAT_NV12,
-	DRM_FORMAT_NV16,
-	DRM_FORMAT_NV24,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_VYUY,
+	DRM_FORMAT_NV12, /* yuv420_8bit linear mode, 2 plane */
+	DRM_FORMAT_NV15, /* yuv420_10bit linear mode, 2 plane, no padding */
+	DRM_FORMAT_NV16, /* yuv422_8bit linear mode, 2 plane */
+	DRM_FORMAT_NV24, /* yuv444_8bit linear mode, 2 plane */
+	DRM_FORMAT_YVYU, /* yuv422_8bit[YVYU] linear mode */
+	DRM_FORMAT_VYUY, /* yuv422_8bit[VYUY] linear mode */
 };
 
 static const uint32_t formats_win_lite[] = {