drm/msm/dpu: move hw_inf encoder baseclass
PATCH 1/2 drm/msm/dpu: move hw_inf encoder baseclass
Both video and command physical encoders will have a hw interface assigned to it. So there is really no need to track the hw block in specific encoder subclass.
Signed-off-by Jeykumar Sankaran <[email protected]>
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 4 +- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 125 +++++++++------------ 2 files changed, 52 insertions(+), 77 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +2 -2
@@ -201,6 +201,7 @@ struct dpu_encoder_irq {* @hw_mdptop: Hardware interface to the top registers * @hw_ctl: Hardware interface to the ctl registers * @hw_pp: Hardware interface to the ping pong registers +* @hw_intf: Hardware interface to the intf registers * @dpu_kms: Pointer to the dpu_kms top level * @cached_mode: DRM mode cached at mode_set time, acted on in enable * @enabled: Whether the encoder has enabled and running a mode
@@ -229,6 +230,7 @@ struct dpu_encoder_phys {struct dpu_hw_mdp *hw_mdptop;struct dpu_hw_ctl *hw_ctl;struct dpu_hw_pingpong *hw_pp; +struct dpu_hw_intf *hw_intf;struct dpu_kms *dpu_kms;struct drm_display_mode cached_mode;enum dpu_enc_split_role split_role;
@@ -255,12 +257,10 @@ static inline int dpu_encoder_phys_inc_pending(struct dpu_encoder_phys *phys)* struct dpu_encoder_phys_vid - sub-class of dpu_encoder_phys to handle video * mode specific operations * @base: Baseclass physical encoder structure -* @hw_intf: Hardware interface to the intf registers * @timing_params: Current timing parameter */ struct dpu_encoder_phys_vid {struct dpu_encoder_phys base; -struct dpu_hw_intf *hw_intf;struct intf_timing_params timing_params; };
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +50 -75
416 lines not on this page · raw message
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
PATCH 2/2 drm/msm/dpu: remove phys_vid subclass
Not holding any video encoder specific data. Get rid of it.
Signed-off-by Jeykumar Sankaran <[email protected]>
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 11 ----------- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 18 ++++-------------- 2 files changed, 4 insertions(+), 25 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +0 -11
@@ -254,17 +254,6 @@ static inline int dpu_encoder_phys_inc_pending(struct dpu_encoder_phys *phys) }/** -* struct dpu_encoder_phys_vid - sub-class of dpu_encoder_phys to handle video -* mode specific operations -* @base: Baseclass physical encoder structure -* @timing_params: Current timing parameter -*/ -struct dpu_encoder_phys_vid { -struct dpu_encoder_phys base; -struct intf_timing_params timing_params; -}; - -/** * struct dpu_encoder_phys_cmd - sub-class of dpu_encoder_phys to handle command * mode specific operations * @base: Baseclass physical encoder structure
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +4 -14
@@ -240,7 +240,6 @@ static bool dpu_encoder_phys_vid_mode_fixup(static void dpu_encoder_phys_vid_setup_timing_engine (struct dpu_encoder_phys *phys_enc) { -struct dpu_encoder_phys_vid *vid_enc;struct drm_display_mode mode;struct intf_timing_params timing_params = {0 };const struct dpu_format *fmt =NULL ;
@@ -254,7 +253,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine( } mode = phys_enc->cached_mode; - vid_enc =to_dpu_encoder_phys_vid (phys_enc);if (!phys_enc->hw_intf->ops.setup_timing_gen) {DPU_ERROR ("timing engine setup is not supported\n" );return ;
@@ -293,8 +291,6 @@ static void dpu_encoder_phys_vid_setup_timing_engine(spin_unlock_irqrestore (phys_enc->enc_spinlock, lock_flags);programmable_fetch_config (phys_enc, &timing_params); - - vid_enc->timing_params = timing_params; }static void dpu_encoder_phys_vid_vblank_irq (void *arg,int irq_idx)
@@ -515,16 +511,13 @@ static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)static void dpu_encoder_phys_vid_destroy (struct dpu_encoder_phys *phys_enc) { -struct dpu_encoder_phys_vid *vid_enc; -if (!phys_enc) {DPU_ERROR ("invalid encoder\n" );return ; } - vid_enc =to_dpu_encoder_phys_vid (phys_enc);DPU_DEBUG_VIDENC (phys_enc,"\n" ); -kfree (vid_enc); +kfree (phys_enc); } static void dpu_encoder_phys_vid_get_hw_resources(
@@ -747,7 +740,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init( struct dpu_enc_phys_init_params *p) {struct dpu_encoder_phys *phys_enc =NULL ; -struct dpu_encoder_phys_vid *vid_enc =NULL ;struct dpu_encoder_irq *irq;int i, ret =0 ;
@@ -756,14 +748,12 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init( goto fail; } - vid_enc =kzalloc (sizeof (*vid_enc),GFP_KERNEL ); -if (!vid_enc) { + phys_enc =kzalloc (sizeof (*phys_enc),GFP_KERNEL ); +if (!phys_enc) { ret = -ENOMEM ; goto fail; } - phys_enc = &vid_enc->base; - phys_enc->hw_mdptop = p->dpu_kms->hw_mdp; phys_enc->intf_idx = p->intf_idx;
@@ -807,7 +797,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init( fail:DPU_ERROR ("failed to create encoder\n" ); -if (vid_enc) +if (phys_enc)dpu_encoder_phys_vid_destroy (phys_enc);return ERR_PTR (ret);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel