Message ID | 20231025213248.2641962-1-jonas@kwiboo.se (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/rockchip: vop2: Add NV20 and NV30 support | expand |
Hi Jonas, On Wed, 2023-10-25 at 21:32 +0000, Jonas Karlman wrote: > Add support for the 10-bit 4:2:2 and 4:4:4 formats NV20 and NV30. > > These formats can be tested using modetest [1]: > > modetest -P <plane_id>@<crtc_id>:1920x1080@<format> > > e.g. on a ROCK 3 Model A (rk3568): > > modetest -P 43@67:1920x1080@NV20 -F tiles,tiles > modetest -P 43@67:1920x1080@NV30 -F smpte,smpte > > [1] https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/329 > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Christopher Obbard <chris.obbard@collabora.com> Tested-by: Christopher Obbard <chris.obbard@collabora.com> > --- > drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++++ > drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > index ab944010fe14..592f9d726f2e 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > @@ -326,11 +326,14 @@ static enum vop2_data_format vop2_convert_format(u32 > format) > case DRM_FORMAT_NV16: > case DRM_FORMAT_NV61: > return VOP2_FMT_YUV422SP; > + case DRM_FORMAT_NV20: > case DRM_FORMAT_Y210: > return VOP2_FMT_YUV422SP_10; > case DRM_FORMAT_NV24: > case DRM_FORMAT_NV42: > return VOP2_FMT_YUV444SP; > + case DRM_FORMAT_NV30: > + return VOP2_FMT_YUV444SP_10; > case DRM_FORMAT_YUYV: > case DRM_FORMAT_YVYU: > return VOP2_FMT_VYUY422; > @@ -415,6 +418,8 @@ static bool vop2_win_uv_swap(u32 format) > case DRM_FORMAT_NV16: > case DRM_FORMAT_NV24: > case DRM_FORMAT_NV15: > + case DRM_FORMAT_NV20: > + case DRM_FORMAT_NV30: > case DRM_FORMAT_YUYV: > case DRM_FORMAT_UYVY: > return true; > diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c > b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c > index fdb48571efce..0b4280218a59 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c > +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c > @@ -48,8 +48,10 @@ static const uint32_t formats_rk356x_esmart[] = { > DRM_FORMAT_NV15, /* yuv420_10bit linear mode, 2 plane, no padding > */ > DRM_FORMAT_NV16, /* yuv422_8bit linear mode, 2 plane */ > DRM_FORMAT_NV61, /* yuv422_8bit linear mode, 2 plane */ > + DRM_FORMAT_NV20, /* yuv422_10bit linear mode, 2 plane, no padding > */ > DRM_FORMAT_NV24, /* yuv444_8bit linear mode, 2 plane */ > DRM_FORMAT_NV42, /* yuv444_8bit linear mode, 2 plane */ > + DRM_FORMAT_NV30, /* yuv444_10bit linear mode, 2 plane, no padding > */ > DRM_FORMAT_YVYU, /* yuv422_8bit[YVYU] linear mode */ > DRM_FORMAT_VYUY, /* yuv422_8bit[VYUY] linear mode */ > };
On Wed, 25 Oct 2023 21:32:46 +0000, Jonas Karlman wrote: > Add support for the 10-bit 4:2:2 and 4:4:4 formats NV20 and NV30. > > These formats can be tested using modetest [1]: > > modetest -P <plane_id>@<crtc_id>:1920x1080@<format> > > e.g. on a ROCK 3 Model A (rk3568): > > [...] Applied, thanks! [1/1] drm/rockchip: vop2: Add NV20 and NV30 support commit: 5fc6aa7db080fd90ef00846aac04e8a211088132 Best regards,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index ab944010fe14..592f9d726f2e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -326,11 +326,14 @@ static enum vop2_data_format vop2_convert_format(u32 format) case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: return VOP2_FMT_YUV422SP; + case DRM_FORMAT_NV20: case DRM_FORMAT_Y210: return VOP2_FMT_YUV422SP_10; case DRM_FORMAT_NV24: case DRM_FORMAT_NV42: return VOP2_FMT_YUV444SP; + case DRM_FORMAT_NV30: + return VOP2_FMT_YUV444SP_10; case DRM_FORMAT_YUYV: case DRM_FORMAT_YVYU: return VOP2_FMT_VYUY422; @@ -415,6 +418,8 @@ static bool vop2_win_uv_swap(u32 format) case DRM_FORMAT_NV16: case DRM_FORMAT_NV24: case DRM_FORMAT_NV15: + case DRM_FORMAT_NV20: + case DRM_FORMAT_NV30: case DRM_FORMAT_YUYV: case DRM_FORMAT_UYVY: return true; diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c index fdb48571efce..0b4280218a59 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c @@ -48,8 +48,10 @@ static const uint32_t formats_rk356x_esmart[] = { DRM_FORMAT_NV15, /* yuv420_10bit linear mode, 2 plane, no padding */ DRM_FORMAT_NV16, /* yuv422_8bit linear mode, 2 plane */ DRM_FORMAT_NV61, /* yuv422_8bit linear mode, 2 plane */ + DRM_FORMAT_NV20, /* yuv422_10bit linear mode, 2 plane, no padding */ DRM_FORMAT_NV24, /* yuv444_8bit linear mode, 2 plane */ DRM_FORMAT_NV42, /* yuv444_8bit linear mode, 2 plane */ + DRM_FORMAT_NV30, /* yuv444_10bit linear mode, 2 plane, no padding */ DRM_FORMAT_YVYU, /* yuv422_8bit[YVYU] linear mode */ DRM_FORMAT_VYUY, /* yuv422_8bit[VYUY] linear mode */ };
Add support for the 10-bit 4:2:2 and 4:4:4 formats NV20 and NV30. These formats can be tested using modetest [1]: modetest -P <plane_id>@<crtc_id>:1920x1080@<format> e.g. on a ROCK 3 Model A (rk3568): modetest -P 43@67:1920x1080@NV20 -F tiles,tiles modetest -P 43@67:1920x1080@NV30 -F smpte,smpte [1] https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/329 Signed-off-by: Jonas Karlman <jonas@kwiboo.se> --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++++ drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 2 ++ 2 files changed, 7 insertions(+)