Skip to content

Commit f07c994

Browse files
Jessica Zhanglumag
authored andcommitted
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: Jessica Zhang <[email protected]> Reviewed-by: Rob Clark <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/500822/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent da7716a commit f07c994

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,12 @@ static const struct dpu_format dpu_format_map[] = {
434434
DPU_CHROMA_H2V1, DPU_FORMAT_FLAG_YUV,
435435
DPU_FETCH_LINEAR, 2),
436436

437+
PSEUDO_YUV_FMT_LOOSE(P010,
438+
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
439+
C1_B_Cb, C2_R_Cr,
440+
DPU_CHROMA_420, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_YUV,
441+
DPU_FETCH_LINEAR, 2),
442+
437443
INTERLEAVED_YUV_FMT(VYUY,
438444
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
439445
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[] = {
536542
DPU_CHROMA_420, DPU_FORMAT_FLAG_YUV |
537543
DPU_FORMAT_FLAG_COMPRESSED,
538544
DPU_FETCH_UBWC, 4, DPU_TILE_HEIGHT_NV12),
545+
546+
PSEUDO_YUV_FMT_TILED(P010,
547+
0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
548+
C1_B_Cb, C2_R_Cr,
549+
DPU_CHROMA_420, DPU_FORMAT_FLAG_DX |
550+
DPU_FORMAT_FLAG_YUV |
551+
DPU_FORMAT_FLAG_COMPRESSED,
552+
DPU_FETCH_UBWC, 4, DPU_TILE_HEIGHT_UBWC),
539553
};
540554

541555
/* _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)
584598
int color_fmt = -1;
585599
int i;
586600

587-
if (fmt->base.pixel_format == DRM_FORMAT_NV12) {
601+
if (fmt->base.pixel_format == DRM_FORMAT_NV12 ||
602+
fmt->base.pixel_format == DRM_FORMAT_P010) {
588603
if (DPU_FORMAT_IS_DX(fmt)) {
589604
if (fmt->unpack_tight)
590605
color_fmt = COLOR_FMT_NV12_BPP10_UBWC;

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ static const uint32_t plane_formats_yuv[] = {
210210
DRM_FORMAT_RGBX4444,
211211
DRM_FORMAT_BGRX4444,
212212

213+
DRM_FORMAT_P010,
213214
DRM_FORMAT_NV12,
214215
DRM_FORMAT_NV21,
215216
DRM_FORMAT_NV16,

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const uint32_t qcom_compressed_supported_formats[] = {
7373
DRM_FORMAT_BGR565,
7474

7575
DRM_FORMAT_NV12,
76+
DRM_FORMAT_P010,
7677
};
7778

7879
/**

0 commit comments

Comments
 (0)