Commit f07c9946 authored by Jessica Zhang's avatar Jessica Zhang Committed by Dmitry Baryshkov

drm/msm/dpu: Add support for P010 format

Add support for P010 color format. This adds support for both linear and
compressed formats.
Signed-off-by: default avatarJessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/500822/
Link: https://lore.kernel.org/r/20220901203422.217-3-quic_jesszhan@quicinc.comSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent da7716a2
...@@ -434,6 +434,12 @@ static const struct dpu_format dpu_format_map[] = { ...@@ -434,6 +434,12 @@ static const struct dpu_format dpu_format_map[] = {
DPU_CHROMA_H2V1, DPU_FORMAT_FLAG_YUV, DPU_CHROMA_H2V1, DPU_FORMAT_FLAG_YUV,
DPU_FETCH_LINEAR, 2), DPU_FETCH_LINEAR, 2),
PSEUDO_YUV_FMT_LOOSE(P010,
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
C1_B_Cb, C2_R_Cr,
DPU_CHROMA_420, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_YUV,
DPU_FETCH_LINEAR, 2),
INTERLEAVED_YUV_FMT(VYUY, INTERLEAVED_YUV_FMT(VYUY,
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, 0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
C2_R_Cr, C0_G_Y, C1_B_Cb, C0_G_Y, C2_R_Cr, C0_G_Y, C1_B_Cb, C0_G_Y,
...@@ -536,6 +542,14 @@ static const struct dpu_format dpu_format_map_ubwc[] = { ...@@ -536,6 +542,14 @@ static const struct dpu_format dpu_format_map_ubwc[] = {
DPU_CHROMA_420, DPU_FORMAT_FLAG_YUV | DPU_CHROMA_420, DPU_FORMAT_FLAG_YUV |
DPU_FORMAT_FLAG_COMPRESSED, DPU_FORMAT_FLAG_COMPRESSED,
DPU_FETCH_UBWC, 4, DPU_TILE_HEIGHT_NV12), DPU_FETCH_UBWC, 4, DPU_TILE_HEIGHT_NV12),
PSEUDO_YUV_FMT_TILED(P010,
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
C1_B_Cb, C2_R_Cr,
DPU_CHROMA_420, DPU_FORMAT_FLAG_DX |
DPU_FORMAT_FLAG_YUV |
DPU_FORMAT_FLAG_COMPRESSED,
DPU_FETCH_UBWC, 4, DPU_TILE_HEIGHT_UBWC),
}; };
/* _dpu_get_v_h_subsample_rate - Get subsample rates for all formats we support /* _dpu_get_v_h_subsample_rate - Get subsample rates for all formats we support
...@@ -584,7 +598,8 @@ static int _dpu_format_get_media_color_ubwc(const struct dpu_format *fmt) ...@@ -584,7 +598,8 @@ static int _dpu_format_get_media_color_ubwc(const struct dpu_format *fmt)
int color_fmt = -1; int color_fmt = -1;
int i; int i;
if (fmt->base.pixel_format == DRM_FORMAT_NV12) { if (fmt->base.pixel_format == DRM_FORMAT_NV12 ||
fmt->base.pixel_format == DRM_FORMAT_P010) {
if (DPU_FORMAT_IS_DX(fmt)) { if (DPU_FORMAT_IS_DX(fmt)) {
if (fmt->unpack_tight) if (fmt->unpack_tight)
color_fmt = COLOR_FMT_NV12_BPP10_UBWC; color_fmt = COLOR_FMT_NV12_BPP10_UBWC;
......
...@@ -210,6 +210,7 @@ static const uint32_t plane_formats_yuv[] = { ...@@ -210,6 +210,7 @@ static const uint32_t plane_formats_yuv[] = {
DRM_FORMAT_RGBX4444, DRM_FORMAT_RGBX4444,
DRM_FORMAT_BGRX4444, DRM_FORMAT_BGRX4444,
DRM_FORMAT_P010,
DRM_FORMAT_NV12, DRM_FORMAT_NV12,
DRM_FORMAT_NV21, DRM_FORMAT_NV21,
DRM_FORMAT_NV16, DRM_FORMAT_NV16,
......
...@@ -73,6 +73,7 @@ static const uint32_t qcom_compressed_supported_formats[] = { ...@@ -73,6 +73,7 @@ static const uint32_t qcom_compressed_supported_formats[] = {
DRM_FORMAT_BGR565, DRM_FORMAT_BGR565,
DRM_FORMAT_NV12, DRM_FORMAT_NV12,
DRM_FORMAT_P010,
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment