mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
drm/msm/dpu: drop redundant num_planes assignment in _dpu_format_populate_plane_sizes*()
Drop redundant layout->num_planes assignments, using the value assigned from the formats table. RGB UBWC formats need special handling: they use two planes (per the format table), but the uAPI defines plane[1] as empty. Reviewed-by: Jessica Zhang <jessica.zhang@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/688180/ Link: https://lore.kernel.org/r/20251114-dpu-formats-v3-10-cae312379d49@oss.qualcomm.com Tested-by: Luca Weiss <luca.weiss@fairphone.com> # qcm6490-fairphone-fp5 Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
parent
72f20360d4
commit
d4db3a06c5
|
|
@ -110,7 +110,6 @@ static int _dpu_format_populate_plane_sizes_ubwc(
|
|||
uint32_t y_meta_scanlines = 0;
|
||||
uint32_t uv_meta_scanlines = 0;
|
||||
|
||||
layout->num_planes = 2;
|
||||
layout->plane_pitch[0] = VENUS_Y_STRIDE(color, fb->width);
|
||||
y_sclines = VENUS_Y_SCANLINES(color, fb->height);
|
||||
layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] *
|
||||
|
|
@ -124,7 +123,6 @@ static int _dpu_format_populate_plane_sizes_ubwc(
|
|||
if (!meta)
|
||||
return 0;
|
||||
|
||||
layout->num_planes += 2;
|
||||
layout->plane_pitch[2] = VENUS_Y_META_STRIDE(color, fb->width);
|
||||
y_meta_scanlines = VENUS_Y_META_SCANLINES(color, fb->height);
|
||||
layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] *
|
||||
|
|
@ -138,8 +136,6 @@ static int _dpu_format_populate_plane_sizes_ubwc(
|
|||
} else {
|
||||
uint32_t rgb_scanlines, rgb_meta_scanlines;
|
||||
|
||||
layout->num_planes = 1;
|
||||
|
||||
layout->plane_pitch[0] = VENUS_RGB_STRIDE(color, fb->width);
|
||||
rgb_scanlines = VENUS_RGB_SCANLINES(color, fb->height);
|
||||
layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] *
|
||||
|
|
@ -148,7 +144,9 @@ static int _dpu_format_populate_plane_sizes_ubwc(
|
|||
if (!meta)
|
||||
return 0;
|
||||
|
||||
layout->num_planes += 2;
|
||||
/* uAPI leaves plane[1] empty and plane[2] as meta */
|
||||
layout->num_planes += 1;
|
||||
|
||||
layout->plane_pitch[2] = VENUS_RGB_META_STRIDE(color, fb->width);
|
||||
rgb_meta_scanlines = VENUS_RGB_META_SCANLINES(color, fb->height);
|
||||
layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] *
|
||||
|
|
@ -167,7 +165,6 @@ static int _dpu_format_populate_plane_sizes_linear(
|
|||
|
||||
/* Due to memset above, only need to set planes of interest */
|
||||
if (fmt->fetch_type == MDP_PLANE_INTERLEAVED) {
|
||||
layout->num_planes = 1;
|
||||
layout->plane_size[0] = fb->width * fb->height * fmt->bpp;
|
||||
layout->plane_pitch[0] = fb->width * fmt->bpp;
|
||||
} else {
|
||||
|
|
@ -194,12 +191,10 @@ static int _dpu_format_populate_plane_sizes_linear(
|
|||
(fb->height / v_subsample);
|
||||
|
||||
if (fmt->fetch_type == MDP_PLANE_PSEUDO_PLANAR) {
|
||||
layout->num_planes = 2;
|
||||
layout->plane_size[1] *= 2;
|
||||
layout->plane_pitch[1] *= 2;
|
||||
} else {
|
||||
/* planar */
|
||||
layout->num_planes = 3;
|
||||
layout->plane_size[2] = layout->plane_size[1];
|
||||
layout->plane_pitch[2] = layout->plane_pitch[1];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user