Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+3 -8
+3 -8
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
··· 110 110 uint32_t y_meta_scanlines = 0; 111 111 uint32_t uv_meta_scanlines = 0; 112 112 113 - layout->num_planes = 2; 114 113 layout->plane_pitch[0] = VENUS_Y_STRIDE(color, fb->width); 115 114 y_sclines = VENUS_Y_SCANLINES(color, fb->height); 116 115 layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] * ··· 123 124 if (!meta) 124 125 return 0; 125 126 126 - layout->num_planes += 2; 127 127 layout->plane_pitch[2] = VENUS_Y_META_STRIDE(color, fb->width); 128 128 y_meta_scanlines = VENUS_Y_META_SCANLINES(color, fb->height); 129 129 layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] * ··· 136 138 } else { 137 139 uint32_t rgb_scanlines, rgb_meta_scanlines; 138 140 139 - layout->num_planes = 1; 140 - 141 141 layout->plane_pitch[0] = VENUS_RGB_STRIDE(color, fb->width); 142 142 rgb_scanlines = VENUS_RGB_SCANLINES(color, fb->height); 143 143 layout->plane_size[0] = MSM_MEDIA_ALIGN(layout->plane_pitch[0] * ··· 144 148 if (!meta) 145 149 return 0; 146 150 147 - layout->num_planes += 2; 151 + /* uAPI leaves plane[1] empty and plane[2] as meta */ 152 + layout->num_planes += 1; 153 + 148 154 layout->plane_pitch[2] = VENUS_RGB_META_STRIDE(color, fb->width); 149 155 rgb_meta_scanlines = VENUS_RGB_META_SCANLINES(color, fb->height); 150 156 layout->plane_size[2] = MSM_MEDIA_ALIGN(layout->plane_pitch[2] * ··· 165 167 166 168 /* Due to memset above, only need to set planes of interest */ 167 169 if (fmt->fetch_type == MDP_PLANE_INTERLEAVED) { 168 - layout->num_planes = 1; 169 170 layout->plane_size[0] = fb->width * fb->height * fmt->bpp; 170 171 layout->plane_pitch[0] = fb->width * fmt->bpp; 171 172 } else { ··· 191 194 (fb->height / v_subsample); 192 195 193 196 if (fmt->fetch_type == MDP_PLANE_PSEUDO_PLANAR) { 194 - layout->num_planes = 2; 195 197 layout->plane_size[1] *= 2; 196 198 layout->plane_pitch[1] *= 2; 197 199 } else { 198 200 /* planar */ 199 - layout->num_planes = 3; 200 201 layout->plane_size[2] = layout->plane_size[1]; 201 202 layout->plane_pitch[2] = layout->plane_pitch[1]; 202 203 }