Skip to content

Commit 7e9d4cd

Browse files
fltorobclark
authored andcommitted
drm/msm/dpu: move some sspp caps to dpu_caps
This isn't something that ever changes between planes, so move it to dpu_caps struct. Making this change will allow more re-use in the "SSPP sub blocks config" part of the catalog, in particular when adding support for SM8150 and SM8250 which have different max_linewidth. This also sets max_hdeci_exp/max_vdeci_exp to 0 for sc7180, as decimation is not supported on the newest DPU versions. (note that decimation is not implemented, so this changes nothing) Signed-off-by: Jonathan Marek <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 544d8b9 commit 7e9d4cd

File tree

3 files changed

+17
-27
lines changed

3 files changed

+17
-27
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ static const struct dpu_caps sdm845_dpu_caps = {
7070
.has_dim_layer = true,
7171
.has_idle_pc = true,
7272
.has_3d_merge = true,
73+
.max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
74+
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
75+
.max_hdeci_exp = MAX_HORZ_DECIMATION,
76+
.max_vdeci_exp = MAX_VERT_DECIMATION,
7377
};
7478

7579
static const struct dpu_caps sc7180_dpu_caps = {
@@ -80,6 +84,8 @@ static const struct dpu_caps sc7180_dpu_caps = {
8084
.ubwc_version = DPU_HW_UBWC_VER_20,
8185
.has_dim_layer = true,
8286
.has_idle_pc = true,
87+
.max_linewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
88+
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
8389
};
8490

8591
static const struct dpu_mdp_cfg sdm845_mdp[] = {
@@ -178,16 +184,9 @@ static const struct dpu_ctl_cfg sc7180_ctl[] = {
178184
*************************************************************/
179185

180186
/* SSPP common configuration */
181-
static const struct dpu_sspp_blks_common sdm845_sspp_common = {
182-
.maxlinewidth = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
183-
.pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
184-
.maxhdeciexp = MAX_HORZ_DECIMATION,
185-
.maxvdeciexp = MAX_VERT_DECIMATION,
186-
};
187187

188188
#define _VIG_SBLK(num, sdma_pri, qseed_ver) \
189189
{ \
190-
.common = &sdm845_sspp_common, \
191190
.maxdwnscale = MAX_DOWNSCALE_RATIO, \
192191
.maxupscale = MAX_UPSCALE_RATIO, \
193192
.smart_dma_priority = sdma_pri, \
@@ -207,7 +206,6 @@ static const struct dpu_sspp_blks_common sdm845_sspp_common = {
207206

208207
#define _DMA_SBLK(num, sdma_pri) \
209208
{ \
210-
.common = &sdm845_sspp_common, \
211209
.maxdwnscale = SSPP_UNITY_SCALE, \
212210
.maxupscale = SSPP_UNITY_SCALE, \
213211
.smart_dma_priority = sdma_pri, \

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

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ struct dpu_qos_lut_tbl {
301301
* @has_dim_layer dim layer feature status
302302
* @has_idle_pc indicate if idle power collapse feature is supported
303303
* @has_3d_merge indicate if 3D merge is supported
304+
* @max_linewidth max linewidth for sspp
305+
* @pixel_ram_size size of latency hiding and de-tiling buffer in bytes
306+
* @max_hdeci_exp max horizontal decimation supported (max is 2^value)
307+
* @max_vdeci_exp max vertical decimation supported (max is 2^value)
304308
*/
305309
struct dpu_caps {
306310
u32 max_mixer_width;
@@ -312,22 +316,11 @@ struct dpu_caps {
312316
bool has_dim_layer;
313317
bool has_idle_pc;
314318
bool has_3d_merge;
315-
};
316-
317-
/**
318-
* struct dpu_sspp_blks_common : SSPP sub-blocks common configuration
319-
* @maxwidth: max pixelwidth supported by this pipe
320-
* @pixel_ram_size: size of latency hiding and de-tiling buffer in bytes
321-
* @maxhdeciexp: max horizontal decimation supported by this pipe
322-
* (max is 2^value)
323-
* @maxvdeciexp: max vertical decimation supported by this pipe
324-
* (max is 2^value)
325-
*/
326-
struct dpu_sspp_blks_common {
327-
u32 maxlinewidth;
319+
/* SSPP limits */
320+
u32 max_linewidth;
328321
u32 pixel_ram_size;
329-
u32 maxhdeciexp;
330-
u32 maxvdeciexp;
322+
u32 max_hdeci_exp;
323+
u32 max_vdeci_exp;
331324
};
332325

333326
/**
@@ -353,7 +346,6 @@ struct dpu_sspp_blks_common {
353346
* @virt_num_formats: Number of supported formats for virtual planes
354347
*/
355348
struct dpu_sspp_sub_blks {
356-
const struct dpu_sspp_blks_common *common;
357349
u32 creq_vblank;
358350
u32 danger_vblank;
359351
u32 maxdwnscale;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
153153

154154
pdpu = to_dpu_plane(plane);
155155
pstate = to_dpu_plane_state(plane->state);
156-
fixed_buff_size = pdpu->pipe_sblk->common->pixel_ram_size;
156+
fixed_buff_size = pdpu->catalog->caps->pixel_ram_size;
157157

158158
list_for_each_entry(tmp, &pdpu->mplane_list, mplane_list) {
159159
if (!tmp->base.state->visible)
@@ -709,7 +709,7 @@ int dpu_plane_validate_multirect_v2(struct dpu_multirect_plane_states *plane)
709709
* So we cannot support more than half of the supported SSPP
710710
* width for tiled formats.
711711
*/
712-
width_threshold = dpu_plane[i]->pipe_sblk->common->maxlinewidth;
712+
width_threshold = dpu_plane[i]->catalog->caps->max_linewidth;
713713
if (has_tiled_rect)
714714
width_threshold /= 2;
715715

@@ -887,7 +887,7 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
887887
fb_rect.x2 = state->fb->width;
888888
fb_rect.y2 = state->fb->height;
889889

890-
max_linewidth = pdpu->pipe_sblk->common->maxlinewidth;
890+
max_linewidth = pdpu->catalog->caps->max_linewidth;
891891

892892
fmt = to_dpu_format(msm_framebuffer_format(state->fb));
893893

0 commit comments

Comments
 (0)