Skip to content

Commit 0e67f51

Browse files
committed
drm/msm: merge dpu_format and mdp_format in struct msm_format
Structures dpu_format and mdp_format are largely the same structures. In order to remove duplication between format databases, merge these two stucture definitions into the global struct msm_format. Reviewed-by: Abhinav Kumar <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/590434/ Link: https://lore.kernel.org/r/[email protected]
1 parent 7120d8a commit 0e67f51

28 files changed

+295
-304
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static bool dpu_crtc_get_scanout_position(struct drm_crtc *crtc,
320320
}
321321

322322
static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
323-
struct dpu_plane_state *pstate, struct dpu_format *format)
323+
struct dpu_plane_state *pstate, const struct msm_format *format)
324324
{
325325
struct dpu_hw_mixer *lm = mixer->hw_lm;
326326
uint32_t blend_op;
@@ -363,7 +363,7 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
363363
fg_alpha, bg_alpha, blend_op);
364364

365365
DRM_DEBUG_ATOMIC("format:%p4cc, alpha_en:%u blend_op:0x%x\n",
366-
&format->base.pixel_format, format->alpha_enable, blend_op);
366+
&format->pixel_format, format->alpha_enable, blend_op);
367367
}
368368

369369
static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc)
@@ -395,7 +395,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc,
395395
struct dpu_crtc_mixer *mixer,
396396
u32 num_mixers,
397397
enum dpu_stage stage,
398-
struct dpu_format *format,
398+
const struct msm_format *format,
399399
uint64_t modifier,
400400
struct dpu_sw_pipe *pipe,
401401
unsigned int stage_idx,
@@ -412,7 +412,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc,
412412

413413
trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane),
414414
state, to_dpu_plane_state(state), stage_idx,
415-
format->base.pixel_format,
415+
format->pixel_format,
416416
modifier);
417417

418418
DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d multirect_idx %d\n",
@@ -440,7 +440,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
440440
struct drm_plane_state *state;
441441
struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
442442
struct dpu_plane_state *pstate = NULL;
443-
struct dpu_format *format;
443+
const struct msm_format *format;
444444
struct dpu_hw_ctl *ctl = mixer->lm_ctl;
445445

446446
uint32_t lm_idx;
@@ -459,7 +459,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
459459
pstate = to_dpu_plane_state(state);
460460
fb = state->fb;
461461

462-
format = to_dpu_format(msm_framebuffer_format(pstate->base.fb));
462+
format = msm_framebuffer_format(pstate->base.fb);
463463

464464
if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable)
465465
bg_alpha_enable = true;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static int dpu_encoder_virt_atomic_check(
675675
if (disp_info->intf_type == INTF_WB && conn_state->writeback_job) {
676676
fb = conn_state->writeback_job->fb;
677677

678-
if (fb && DPU_FORMAT_IS_YUV(to_dpu_format(msm_framebuffer_format(fb))))
678+
if (fb && MSM_FORMAT_IS_YUV(msm_framebuffer_format(fb)))
679679
topology.needs_cdm = true;
680680
} else if (disp_info->intf_type == INTF_DP) {
681681
if (msm_dp_is_yuv_420_enabled(priv->dp[disp_info->h_tile_instance[0]], adj_mode))
@@ -2184,7 +2184,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
21842184
}
21852185

21862186
void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
2187-
const struct dpu_format *dpu_fmt,
2187+
const struct msm_format *dpu_fmt,
21882188
u32 output_type)
21892189
{
21902190
struct dpu_hw_cdm *hw_cdm;
@@ -2202,9 +2202,9 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
22022202
if (!hw_cdm)
22032203
return;
22042204

2205-
if (!DPU_FORMAT_IS_YUV(dpu_fmt)) {
2205+
if (!MSM_FORMAT_IS_YUV(dpu_fmt)) {
22062206
DPU_DEBUG("[enc:%d] cdm_disable fmt:%p4cc\n", DRMID(phys_enc->parent),
2207-
&dpu_fmt->base.pixel_format);
2207+
&dpu_fmt->pixel_format);
22082208
if (hw_cdm->ops.bind_pingpong_blk)
22092209
hw_cdm->ops.bind_pingpong_blk(hw_cdm, PINGPONG_NONE);
22102210

@@ -2217,7 +2217,7 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
22172217
cdm_cfg->output_height = phys_enc->cached_mode.vdisplay;
22182218
cdm_cfg->output_fmt = dpu_fmt;
22192219
cdm_cfg->output_type = output_type;
2220-
cdm_cfg->output_bit_depth = DPU_FORMAT_IS_DX(dpu_fmt) ?
2220+
cdm_cfg->output_bit_depth = MSM_FORMAT_IS_DX(dpu_fmt) ?
22212221
CDM_CDWN_OUTPUT_10BIT : CDM_CDWN_OUTPUT_8BIT;
22222222
cdm_cfg->csc_cfg = &dpu_csc10_rgb2yuv_601l;
22232223

@@ -2246,7 +2246,7 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
22462246

22472247
DPU_DEBUG("[enc:%d] cdm_enable:%d,%d,%p4cc,%d,%d,%d,%d]\n",
22482248
DRMID(phys_enc->parent), cdm_cfg->output_width,
2249-
cdm_cfg->output_height, &cdm_cfg->output_fmt->base.pixel_format,
2249+
cdm_cfg->output_height, &cdm_cfg->output_fmt->pixel_format,
22502250
cdm_cfg->output_type, cdm_cfg->output_bit_depth,
22512251
cdm_cfg->h_cdwn_type, cdm_cfg->v_cdwn_type);
22522252

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc);
393393
* @output_type: HDMI/WB
394394
*/
395395
void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
396-
const struct dpu_format *dpu_fmt,
396+
const struct msm_format *dpu_fmt,
397397
u32 output_type);
398398

399399
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
235235
{
236236
struct drm_display_mode mode;
237237
struct dpu_hw_intf_timing_params timing_params = { 0 };
238-
const struct dpu_format *fmt = NULL;
238+
const struct msm_format *fmt = NULL;
239239
u32 fmt_fourcc;
240240
unsigned long lock_flags;
241241
struct dpu_hw_intf_cfg intf_cfg = { 0 };
@@ -409,7 +409,7 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
409409
static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
410410
{
411411
struct dpu_hw_ctl *ctl;
412-
const struct dpu_format *fmt;
412+
const struct msm_format *fmt;
413413
u32 fmt_fourcc;
414414

415415
ctl = phys_enc->hw_ctl;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static void dpu_encoder_phys_wb_setup(
322322
struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
323323
struct drm_writeback_job *wb_job;
324324
const struct msm_format *format;
325-
const struct dpu_format *dpu_fmt;
325+
const struct msm_format *dpu_fmt;
326326

327327
wb_job = wb_enc->wb_job;
328328
format = msm_framebuffer_format(wb_enc->wb_job->fb);
@@ -594,7 +594,7 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc
594594
wb_cfg->dest.height = job->fb->height;
595595
wb_cfg->dest.num_planes = wb_cfg->dest.format->num_planes;
596596

597-
if ((wb_cfg->dest.format->fetch_planes == MDP_PLANE_PLANAR) &&
597+
if ((wb_cfg->dest.format->fetch_type == MDP_PLANE_PLANAR) &&
598598
(wb_cfg->dest.format->element[0] == C1_B_Cb))
599599
swap(wb_cfg->dest.plane_addr[1], wb_cfg->dest.plane_addr[2]);
600600

0 commit comments

Comments
 (0)