* [PATCH 0/6] drm/msm: dpu: Various cleanup patches
@ 2018-09-20 14:58 Sean Paul
[not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw)
To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA
Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul,
abhinavk-sgV2jX0FEOL9JmXXK+q4OQ
From: Sean Paul <seanpaul@chromium.org>
I kept notes of things to revisit while I was working on the cursor.
These are the low-hanging fruit that I noticed.
Sean
Sean Paul (6):
drm/msm: Remove dpu_encoder_phys_ops->hw_reset()
drm/msm: dpu: Remove unused functions from msm_media_info.h
drm/msm: dpu: Remove _dpu_encoder_power_enable()
drm/msm: dpu: Remove 'inline' from several functions
drm/msm: dpu: Remove empty/useless labels
drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected()
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 16 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 43 +---
.../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 12 --
.../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 9 +-
.../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 5 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 5 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 6 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c | 12 +-
.../gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 3 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 15 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 20 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 4 +-
.../gpu/drm/msm/disp/dpu1/msm_media_info.h | 195 ++----------------
16 files changed, 52 insertions(+), 309 deletions(-)
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 14+ messages in thread[parent not found: <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* [PATCH 1/6] drm/msm: Remove dpu_encoder_phys_ops->hw_reset() [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 2/6] drm/msm: dpu: Remove unused functions from msm_media_info.h Sean Paul ` (4 subsequent siblings) 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> We call out of the virt encoder into phys only to call back into the virt for hw reset. So remove the indirection and just call the virt function directly. Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 ++---- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 12 ------------ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 - drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 - 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 8f6880db5c99..7842b66fbe2e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -1509,7 +1509,7 @@ static int dpu_encoder_helper_wait_event_timeout( return rc; } -void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc) +static void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc) { struct dpu_encoder_virt *dpu_enc; struct dpu_hw_ctl *ctl; @@ -1805,9 +1805,7 @@ void dpu_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc, if (needs_hw_reset) { trace_dpu_enc_prepare_kickoff_reset(DRMID(drm_enc)); for (i = 0; i < dpu_enc->num_phys_encs; i++) { - phys = dpu_enc->phys_encs[i]; - if (phys && phys->ops.hw_reset) - phys->ops.hw_reset(phys); + dpu_encoder_helper_hw_reset(dpu_enc->phys_encs[i]); } } } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index 964efcc757a4..3a67bb9f9d9d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -114,8 +114,6 @@ struct dpu_encoder_virt_ops { * @handle_post_kickoff: Do any work necessary post-kickoff work * @trigger_start: Process start event on physical encoder * @needs_single_flush: Whether encoder slaves need to be flushed - * @hw_reset: Issue HW recovery such as CTL reset and clear - * DPU_ENC_ERR_NEEDS_HW_RESET state * @irq_control: Handler to enable/disable all the encoder IRQs * @prepare_idle_pc: phys encoder can update the vsync_enable status * on idle power collapse prepare @@ -151,7 +149,6 @@ struct dpu_encoder_phys_ops { void (*handle_post_kickoff)(struct dpu_encoder_phys *phys_enc); void (*trigger_start)(struct dpu_encoder_phys *phys_enc); bool (*needs_single_flush)(struct dpu_encoder_phys *phys_enc); - void (*hw_reset)(struct dpu_encoder_phys *phys_enc); void (*irq_control)(struct dpu_encoder_phys *phys, bool enable); void (*prepare_idle_pc)(struct dpu_encoder_phys *phys_enc); void (*restore)(struct dpu_encoder_phys *phys); @@ -342,15 +339,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init( */ void dpu_encoder_helper_trigger_start(struct dpu_encoder_phys *phys_enc); -/** - * dpu_encoder_helper_hw_reset - issue ctl hw reset - * This helper function may be optionally specified by physical - * encoders if they require ctl hw reset. If state is currently - * DPU_ENC_ERR_NEEDS_HW_RESET, it is set back to DPU_ENC_ENABLED. - * @phys_enc: Pointer to physical encoder structure - */ -void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc); - static inline enum dpu_3d_blend_mode dpu_encoder_helper_get_3d_blend_mode( struct dpu_encoder_phys *phys_enc) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index b2d7f0ded24c..c30ae05b3349 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -776,7 +776,6 @@ static void dpu_encoder_phys_cmd_init_ops( ops->wait_for_vblank = dpu_encoder_phys_cmd_wait_for_vblank; ops->trigger_start = dpu_encoder_phys_cmd_trigger_start; ops->needs_single_flush = dpu_encoder_phys_cmd_needs_single_flush; - ops->hw_reset = dpu_encoder_helper_hw_reset; ops->irq_control = dpu_encoder_phys_cmd_irq_control; ops->restore = dpu_encoder_phys_cmd_enable_helper; ops->prepare_idle_pc = dpu_encoder_phys_cmd_prepare_idle_pc; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 84de385a9f62..283a2491f3e3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -766,7 +766,6 @@ static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops) ops->prepare_for_kickoff = dpu_encoder_phys_vid_prepare_for_kickoff; ops->handle_post_kickoff = dpu_encoder_phys_vid_handle_post_kickoff; ops->needs_single_flush = dpu_encoder_phys_vid_needs_single_flush; - ops->hw_reset = dpu_encoder_helper_hw_reset; ops->get_line_count = dpu_encoder_phys_vid_get_line_count; } -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 1/6] drm/msm: Remove dpu_encoder_phys_ops->hw_reset() [not found] ` <20180920145818.32468-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:27 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:27 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > We call out of the virt encoder into phys only to call back into the > virt for hw reset. So remove the indirection and just call the virt > function directly. > > Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 ++---- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 12 ------------ > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 - > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 - > 4 files changed, 2 insertions(+), 18 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 8f6880db5c99..7842b66fbe2e 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -1509,7 +1509,7 @@ static int dpu_encoder_helper_wait_event_timeout( > return rc; > } > > -void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc) > +static void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys > *phys_enc) > { > struct dpu_encoder_virt *dpu_enc; > struct dpu_hw_ctl *ctl; > @@ -1805,9 +1805,7 @@ void dpu_encoder_prepare_for_kickoff(struct > drm_encoder *drm_enc, > if (needs_hw_reset) { > trace_dpu_enc_prepare_kickoff_reset(DRMID(drm_enc)); > for (i = 0; i < dpu_enc->num_phys_encs; i++) { > - phys = dpu_enc->phys_encs[i]; > - if (phys && phys->ops.hw_reset) > - phys->ops.hw_reset(phys); > + > dpu_encoder_helper_hw_reset(dpu_enc->phys_encs[i]); > } > } > } > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h > index 964efcc757a4..3a67bb9f9d9d 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h > @@ -114,8 +114,6 @@ struct dpu_encoder_virt_ops { > * @handle_post_kickoff: Do any work necessary post-kickoff work > * @trigger_start: Process start event on physical encoder > * @needs_single_flush: Whether encoder slaves need to be > flushed > - * @hw_reset: Issue HW recovery such as CTL reset and > clear > - * DPU_ENC_ERR_NEEDS_HW_RESET state > * @irq_control: Handler to enable/disable all the encoder > IRQs > * @prepare_idle_pc: phys encoder can update the vsync_enable > status > * on idle power collapse prepare > @@ -151,7 +149,6 @@ struct dpu_encoder_phys_ops { > void (*handle_post_kickoff)(struct dpu_encoder_phys *phys_enc); > void (*trigger_start)(struct dpu_encoder_phys *phys_enc); > bool (*needs_single_flush)(struct dpu_encoder_phys *phys_enc); > - void (*hw_reset)(struct dpu_encoder_phys *phys_enc); > void (*irq_control)(struct dpu_encoder_phys *phys, bool enable); > void (*prepare_idle_pc)(struct dpu_encoder_phys *phys_enc); > void (*restore)(struct dpu_encoder_phys *phys); > @@ -342,15 +339,6 @@ struct dpu_encoder_phys > *dpu_encoder_phys_cmd_init( > */ > void dpu_encoder_helper_trigger_start(struct dpu_encoder_phys > *phys_enc); > > -/** > - * dpu_encoder_helper_hw_reset - issue ctl hw reset > - * This helper function may be optionally specified by physical > - * encoders if they require ctl hw reset. If state is currently > - * DPU_ENC_ERR_NEEDS_HW_RESET, it is set back to DPU_ENC_ENABLED. > - * @phys_enc: Pointer to physical encoder structure > - */ > -void dpu_encoder_helper_hw_reset(struct dpu_encoder_phys *phys_enc); > - > static inline enum dpu_3d_blend_mode > dpu_encoder_helper_get_3d_blend_mode( > struct dpu_encoder_phys *phys_enc) > { > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > index b2d7f0ded24c..c30ae05b3349 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > @@ -776,7 +776,6 @@ static void dpu_encoder_phys_cmd_init_ops( > ops->wait_for_vblank = dpu_encoder_phys_cmd_wait_for_vblank; > ops->trigger_start = dpu_encoder_phys_cmd_trigger_start; > ops->needs_single_flush = dpu_encoder_phys_cmd_needs_single_flush; > - ops->hw_reset = dpu_encoder_helper_hw_reset; > ops->irq_control = dpu_encoder_phys_cmd_irq_control; > ops->restore = dpu_encoder_phys_cmd_enable_helper; > ops->prepare_idle_pc = dpu_encoder_phys_cmd_prepare_idle_pc; > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > index 84de385a9f62..283a2491f3e3 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > @@ -766,7 +766,6 @@ static void dpu_encoder_phys_vid_init_ops(struct > dpu_encoder_phys_ops *ops) > ops->prepare_for_kickoff = > dpu_encoder_phys_vid_prepare_for_kickoff; > ops->handle_post_kickoff = > dpu_encoder_phys_vid_handle_post_kickoff; > ops->needs_single_flush = dpu_encoder_phys_vid_needs_single_flush; > - ops->hw_reset = dpu_encoder_helper_hw_reset; > ops->get_line_count = dpu_encoder_phys_vid_get_line_count; > } -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/6] drm/msm: dpu: Remove unused functions from msm_media_info.h [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 1/6] drm/msm: Remove dpu_encoder_phys_ops->hw_reset() Sean Paul @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-3-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 3/6] drm/msm: dpu: Remove _dpu_encoder_power_enable() Sean Paul ` (3 subsequent siblings) 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> These functions aren't used anywhere, remove them. Signed-off-by: Sean Paul <seanpaul@chromium.org> --- .../gpu/drm/msm/disp/dpu1/msm_media_info.h | 171 ------------------ 1 file changed, 171 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h index 4f12e5c534c8..1a35dfb4a4e5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h +++ b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h @@ -813,18 +813,6 @@ enum color_fmts { #define COLOR_FMT_P010_UBWC COLOR_FMT_P010_UBWC #define COLOR_FMT_P010 COLOR_FMT_P010 -static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height) -{ - (void)height; - (void)width; - - /* - * In the future, calculate the size based on the w/h but just - * hardcode it for now since 16K satisfies all current usecases. - */ - return 16 * 1024; -} - /* * Function arguments: * @color_fmt @@ -1214,163 +1202,4 @@ static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height) return rgb_meta_scanlines; } -/* - * Function arguments: - * @color_fmt - * @width - * Progressive: width - * Interlaced: width - * @height - * Progressive: height - * Interlaced: height - */ -static inline unsigned int VENUS_BUFFER_SIZE( - int color_fmt, int width, int height) -{ - const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, height); - unsigned int uv_alignment = 0, size = 0; - unsigned int y_plane, uv_plane, y_stride, - uv_stride, y_sclines, uv_sclines; - unsigned int y_ubwc_plane = 0, uv_ubwc_plane = 0; - unsigned int y_meta_stride = 0, y_meta_scanlines = 0; - unsigned int uv_meta_stride = 0, uv_meta_scanlines = 0; - unsigned int y_meta_plane = 0, uv_meta_plane = 0; - unsigned int rgb_stride = 0, rgb_scanlines = 0; - unsigned int rgb_plane = 0, rgb_ubwc_plane = 0, rgb_meta_plane = 0; - unsigned int rgb_meta_stride = 0, rgb_meta_scanlines = 0; - - if (!width || !height) - goto invalid_input; - - y_stride = VENUS_Y_STRIDE(color_fmt, width); - uv_stride = VENUS_UV_STRIDE(color_fmt, width); - y_sclines = VENUS_Y_SCANLINES(color_fmt, height); - uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); - rgb_stride = VENUS_RGB_STRIDE(color_fmt, width); - rgb_scanlines = VENUS_RGB_SCANLINES(color_fmt, height); - - switch (color_fmt) { - case COLOR_FMT_NV21: - case COLOR_FMT_NV12: - case COLOR_FMT_P010: - uv_alignment = 4096; - y_plane = y_stride * y_sclines; - uv_plane = uv_stride * uv_sclines + uv_alignment; - size = y_plane + uv_plane + - MSM_MEDIA_MAX(extra_size, 8 * y_stride); - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_NV12_MVTB: - uv_alignment = 4096; - y_plane = y_stride * y_sclines; - uv_plane = uv_stride * uv_sclines + uv_alignment; - size = y_plane + uv_plane; - size = 2 * size + extra_size; - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_NV12_UBWC: - y_sclines = VENUS_Y_SCANLINES(color_fmt, (height+1)>>1); - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096); - uv_sclines = VENUS_UV_SCANLINES(color_fmt, (height+1)>>1); - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096); - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); - y_meta_scanlines = - VENUS_Y_META_SCANLINES(color_fmt, (height+1)>>1); - y_meta_plane = MSM_MEDIA_ALIGN( - y_meta_stride * y_meta_scanlines, 4096); - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); - uv_meta_scanlines = - VENUS_UV_META_SCANLINES(color_fmt, (height+1)>>1); - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * - uv_meta_scanlines, 4096); - - size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane + - uv_meta_plane)*2 + - MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride); - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_NV12_BPP10_UBWC: - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096); - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096); - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); - y_meta_scanlines = VENUS_Y_META_SCANLINES(color_fmt, height); - y_meta_plane = MSM_MEDIA_ALIGN( - y_meta_stride * y_meta_scanlines, 4096); - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); - uv_meta_scanlines = VENUS_UV_META_SCANLINES(color_fmt, height); - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * - uv_meta_scanlines, 4096); - - size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + - uv_meta_plane + - MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride); - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_P010_UBWC: - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, 4096); - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, 4096); - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); - y_meta_scanlines = VENUS_Y_META_SCANLINES(color_fmt, height); - y_meta_plane = MSM_MEDIA_ALIGN( - y_meta_stride * y_meta_scanlines, 4096); - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); - uv_meta_scanlines = VENUS_UV_META_SCANLINES(color_fmt, height); - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * - uv_meta_scanlines, 4096); - - size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + - uv_meta_plane; - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_RGBA8888: - rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, 4096); - size = rgb_plane; - size = MSM_MEDIA_ALIGN(size, 4096); - break; - case COLOR_FMT_RGBA8888_UBWC: - case COLOR_FMT_RGBA1010102_UBWC: - case COLOR_FMT_RGB565_UBWC: - rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, - 4096); - rgb_meta_stride = VENUS_RGB_META_STRIDE(color_fmt, width); - rgb_meta_scanlines = VENUS_RGB_META_SCANLINES(color_fmt, - height); - rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride * - rgb_meta_scanlines, 4096); - size = rgb_ubwc_plane + rgb_meta_plane; - size = MSM_MEDIA_ALIGN(size, 4096); - break; - default: - break; - } -invalid_input: - return size; -} - -static inline unsigned int VENUS_VIEW2_OFFSET( - int color_fmt, int width, int height) -{ - unsigned int offset = 0; - unsigned int y_plane, uv_plane, y_stride, - uv_stride, y_sclines, uv_sclines; - if (!width || !height) - goto invalid_input; - - y_stride = VENUS_Y_STRIDE(color_fmt, width); - uv_stride = VENUS_UV_STRIDE(color_fmt, width); - y_sclines = VENUS_Y_SCANLINES(color_fmt, height); - uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); - switch (color_fmt) { - case COLOR_FMT_NV12_MVTB: - y_plane = y_stride * y_sclines; - uv_plane = uv_stride * uv_sclines; - offset = y_plane + uv_plane; - break; - default: - break; - } -invalid_input: - return offset; -} - #endif -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-3-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 2/6] drm/msm: dpu: Remove unused functions from msm_media_info.h [not found] ` <20180920145818.32468-3-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:27 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:27 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > These functions aren't used anywhere, remove them. > > Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> > --- > .../gpu/drm/msm/disp/dpu1/msm_media_info.h | 171 ------------------ > 1 file changed, 171 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > index 4f12e5c534c8..1a35dfb4a4e5 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > @@ -813,18 +813,6 @@ enum color_fmts { > #define COLOR_FMT_P010_UBWC COLOR_FMT_P010_UBWC > #define COLOR_FMT_P010 COLOR_FMT_P010 > > -static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height) > -{ > - (void)height; > - (void)width; > - > - /* > - * In the future, calculate the size based on the w/h but just > - * hardcode it for now since 16K satisfies all current usecases. > - */ > - return 16 * 1024; > -} > - > /* > * Function arguments: > * @color_fmt > @@ -1214,163 +1202,4 @@ static inline unsigned int > VENUS_RGB_META_SCANLINES(int color_fmt, int height) > return rgb_meta_scanlines; > } > > -/* > - * Function arguments: > - * @color_fmt > - * @width > - * Progressive: width > - * Interlaced: width > - * @height > - * Progressive: height > - * Interlaced: height > - */ > -static inline unsigned int VENUS_BUFFER_SIZE( > - int color_fmt, int width, int height) > -{ > - const unsigned int extra_size = VENUS_EXTRADATA_SIZE(width, > height); > - unsigned int uv_alignment = 0, size = 0; > - unsigned int y_plane, uv_plane, y_stride, > - uv_stride, y_sclines, uv_sclines; > - unsigned int y_ubwc_plane = 0, uv_ubwc_plane = 0; > - unsigned int y_meta_stride = 0, y_meta_scanlines = 0; > - unsigned int uv_meta_stride = 0, uv_meta_scanlines = 0; > - unsigned int y_meta_plane = 0, uv_meta_plane = 0; > - unsigned int rgb_stride = 0, rgb_scanlines = 0; > - unsigned int rgb_plane = 0, rgb_ubwc_plane = 0, rgb_meta_plane = > 0; > - unsigned int rgb_meta_stride = 0, rgb_meta_scanlines = 0; > - > - if (!width || !height) > - goto invalid_input; > - > - y_stride = VENUS_Y_STRIDE(color_fmt, width); > - uv_stride = VENUS_UV_STRIDE(color_fmt, width); > - y_sclines = VENUS_Y_SCANLINES(color_fmt, height); > - uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); > - rgb_stride = VENUS_RGB_STRIDE(color_fmt, width); > - rgb_scanlines = VENUS_RGB_SCANLINES(color_fmt, height); > - > - switch (color_fmt) { > - case COLOR_FMT_NV21: > - case COLOR_FMT_NV12: > - case COLOR_FMT_P010: > - uv_alignment = 4096; > - y_plane = y_stride * y_sclines; > - uv_plane = uv_stride * uv_sclines + uv_alignment; > - size = y_plane + uv_plane + > - MSM_MEDIA_MAX(extra_size, 8 * y_stride); > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_NV12_MVTB: > - uv_alignment = 4096; > - y_plane = y_stride * y_sclines; > - uv_plane = uv_stride * uv_sclines + uv_alignment; > - size = y_plane + uv_plane; > - size = 2 * size + extra_size; > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_NV12_UBWC: > - y_sclines = VENUS_Y_SCANLINES(color_fmt, (height+1)>>1); > - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, > 4096); > - uv_sclines = VENUS_UV_SCANLINES(color_fmt, (height+1)>>1); > - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, > 4096); > - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); > - y_meta_scanlines = > - VENUS_Y_META_SCANLINES(color_fmt, (height+1)>>1); > - y_meta_plane = MSM_MEDIA_ALIGN( > - y_meta_stride * y_meta_scanlines, 4096); > - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); > - uv_meta_scanlines = > - VENUS_UV_META_SCANLINES(color_fmt, (height+1)>>1); > - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * > - uv_meta_scanlines, 4096); > - > - size = (y_ubwc_plane + uv_ubwc_plane + y_meta_plane + > - uv_meta_plane)*2 + > - MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride); > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_NV12_BPP10_UBWC: > - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, > 4096); > - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, > 4096); > - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); > - y_meta_scanlines = VENUS_Y_META_SCANLINES(color_fmt, > height); > - y_meta_plane = MSM_MEDIA_ALIGN( > - y_meta_stride * y_meta_scanlines, 4096); > - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); > - uv_meta_scanlines = VENUS_UV_META_SCANLINES(color_fmt, > height); > - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * > - uv_meta_scanlines, 4096); > - > - size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + > - uv_meta_plane + > - MSM_MEDIA_MAX(extra_size + 8192, 48 * y_stride); > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_P010_UBWC: > - y_ubwc_plane = MSM_MEDIA_ALIGN(y_stride * y_sclines, > 4096); > - uv_ubwc_plane = MSM_MEDIA_ALIGN(uv_stride * uv_sclines, > 4096); > - y_meta_stride = VENUS_Y_META_STRIDE(color_fmt, width); > - y_meta_scanlines = VENUS_Y_META_SCANLINES(color_fmt, > height); > - y_meta_plane = MSM_MEDIA_ALIGN( > - y_meta_stride * y_meta_scanlines, 4096); > - uv_meta_stride = VENUS_UV_META_STRIDE(color_fmt, width); > - uv_meta_scanlines = VENUS_UV_META_SCANLINES(color_fmt, > height); > - uv_meta_plane = MSM_MEDIA_ALIGN(uv_meta_stride * > - uv_meta_scanlines, 4096); > - > - size = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + > - uv_meta_plane; > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_RGBA8888: > - rgb_plane = MSM_MEDIA_ALIGN(rgb_stride * rgb_scanlines, > 4096); > - size = rgb_plane; > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - case COLOR_FMT_RGBA8888_UBWC: > - case COLOR_FMT_RGBA1010102_UBWC: > - case COLOR_FMT_RGB565_UBWC: > - rgb_ubwc_plane = MSM_MEDIA_ALIGN(rgb_stride * > rgb_scanlines, > - 4096); > - rgb_meta_stride = VENUS_RGB_META_STRIDE(color_fmt, width); > - rgb_meta_scanlines = VENUS_RGB_META_SCANLINES(color_fmt, > - height); > - rgb_meta_plane = MSM_MEDIA_ALIGN(rgb_meta_stride * > - rgb_meta_scanlines, 4096); > - size = rgb_ubwc_plane + rgb_meta_plane; > - size = MSM_MEDIA_ALIGN(size, 4096); > - break; > - default: > - break; > - } > -invalid_input: > - return size; > -} > - > -static inline unsigned int VENUS_VIEW2_OFFSET( > - int color_fmt, int width, int height) > -{ > - unsigned int offset = 0; > - unsigned int y_plane, uv_plane, y_stride, > - uv_stride, y_sclines, uv_sclines; > - if (!width || !height) > - goto invalid_input; > - > - y_stride = VENUS_Y_STRIDE(color_fmt, width); > - uv_stride = VENUS_UV_STRIDE(color_fmt, width); > - y_sclines = VENUS_Y_SCANLINES(color_fmt, height); > - uv_sclines = VENUS_UV_SCANLINES(color_fmt, height); > - switch (color_fmt) { > - case COLOR_FMT_NV12_MVTB: > - y_plane = y_stride * y_sclines; > - uv_plane = uv_stride * uv_sclines; > - offset = y_plane + uv_plane; > - break; > - default: > - break; > - } > -invalid_input: > - return offset; > -} > - > #endif -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/6] drm/msm: dpu: Remove _dpu_encoder_power_enable() [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 1/6] drm/msm: Remove dpu_encoder_phys_ops->hw_reset() Sean Paul 2018-09-20 14:58 ` [PATCH 2/6] drm/msm: dpu: Remove unused functions from msm_media_info.h Sean Paul @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-4-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 4/6] drm/msm: dpu: Remove 'inline' from several functions Sean Paul ` (2 subsequent siblings) 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> It's unused, remove it. Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 33 --------------------- 1 file changed, 33 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 7842b66fbe2e..1f7f3c2e09c2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -210,39 +210,6 @@ struct dpu_encoder_virt { }; #define to_dpu_encoder_virt(x) container_of(x, struct dpu_encoder_virt, base) -static inline int _dpu_encoder_power_enable(struct dpu_encoder_virt *dpu_enc, - bool enable) -{ - struct drm_encoder *drm_enc; - struct msm_drm_private *priv; - struct dpu_kms *dpu_kms; - - if (!dpu_enc) { - DPU_ERROR("invalid dpu enc\n"); - return -EINVAL; - } - - drm_enc = &dpu_enc->base; - if (!drm_enc->dev || !drm_enc->dev->dev_private) { - DPU_ERROR("drm device invalid\n"); - return -EINVAL; - } - - priv = drm_enc->dev->dev_private; - if (!priv->kms) { - DPU_ERROR("invalid kms\n"); - return -EINVAL; - } - - dpu_kms = to_dpu_kms(priv->kms); - - if (enable) - pm_runtime_get_sync(&dpu_kms->pdev->dev); - else - pm_runtime_put_sync(&dpu_kms->pdev->dev); - - return 0; -} void dpu_encoder_helper_report_irq_timeout(struct dpu_encoder_phys *phys_enc, enum dpu_intr_idx intr_idx) -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-4-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 3/6] drm/msm: dpu: Remove _dpu_encoder_power_enable() [not found] ` <20180920145818.32468-4-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:27 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:27 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > It's unused, remove it. > > Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 33 --------------------- > 1 file changed, 33 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 7842b66fbe2e..1f7f3c2e09c2 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -210,39 +210,6 @@ struct dpu_encoder_virt { > }; > > #define to_dpu_encoder_virt(x) container_of(x, struct > dpu_encoder_virt, > base) > -static inline int _dpu_encoder_power_enable(struct dpu_encoder_virt > *dpu_enc, > - bool > enable) > -{ > - struct drm_encoder *drm_enc; > - struct msm_drm_private *priv; > - struct dpu_kms *dpu_kms; > - > - if (!dpu_enc) { > - DPU_ERROR("invalid dpu enc\n"); > - return -EINVAL; > - } > - > - drm_enc = &dpu_enc->base; > - if (!drm_enc->dev || !drm_enc->dev->dev_private) { > - DPU_ERROR("drm device invalid\n"); > - return -EINVAL; > - } > - > - priv = drm_enc->dev->dev_private; > - if (!priv->kms) { > - DPU_ERROR("invalid kms\n"); > - return -EINVAL; > - } > - > - dpu_kms = to_dpu_kms(priv->kms); > - > - if (enable) > - pm_runtime_get_sync(&dpu_kms->pdev->dev); > - else > - pm_runtime_put_sync(&dpu_kms->pdev->dev); > - > - return 0; > -} > > void dpu_encoder_helper_report_irq_timeout(struct dpu_encoder_phys > *phys_enc, > enum dpu_intr_idx intr_idx) -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 4/6] drm/msm: dpu: Remove 'inline' from several functions [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> ` (2 preceding siblings ...) 2018-09-20 14:58 ` [PATCH 3/6] drm/msm: dpu: Remove _dpu_encoder_power_enable() Sean Paul @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-5-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels Sean Paul 2018-09-20 14:58 ` [PATCH 6/6] drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() Sean Paul 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> Per chapter 15 of coding-style, removing 'inline' keyword from functions that are larger than a typical macro. In a couple of cases I've simplified the function and kept the inline. Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 16 ++----------- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 6 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c | 12 +++------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 6 ++--- .../gpu/drm/msm/disp/dpu1/msm_media_info.h | 24 +++++++++---------- 9 files changed, 30 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index a8f2dd7a37c7..5ff23f00582b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -53,7 +53,7 @@ static inline int _dpu_crtc_get_mixer_width(struct dpu_crtc_state *cstate, return mode->hdisplay / cstate->num_mixers; } -static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) +static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) { struct msm_drm_private *priv; @@ -70,7 +70,7 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) return to_dpu_kms(priv->kms); } -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable) +static int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable) { struct drm_crtc *crtc; struct msm_drm_private *priv; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h index 3723b4830335..cc18eca8f527 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h @@ -266,13 +266,7 @@ static inline int dpu_crtc_get_mixer_height(struct dpu_crtc *dpu_crtc, */ static inline int dpu_crtc_frame_pending(struct drm_crtc *crtc) { - struct dpu_crtc *dpu_crtc; - - if (!crtc) - return -EINVAL; - - dpu_crtc = to_dpu_crtc(crtc); - return atomic_read(&dpu_crtc->frame_pending); + return crtc ? atomic_read(&to_dpu_crtc(crtc)->frame_pending) : -EINVAL; } /** @@ -329,13 +323,7 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc); static inline enum dpu_crtc_client_type dpu_crtc_get_client_type( struct drm_crtc *crtc) { - struct dpu_crtc_state *cstate = - crtc ? to_dpu_crtc_state(crtc->state) : NULL; - - if (!cstate) - return NRT_CLIENT; - - return RT_CLIENT; + return crtc && crtc->state ? RT_CLIENT : NRT_CLIENT; } /** diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 1f7f3c2e09c2..79a6c6b7350b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -1376,7 +1376,7 @@ static void dpu_encoder_off_work(struct kthread_work *work) * phys: Pointer to physical encoder structure * extra_flush_bits: Additional bit mask to include in flush trigger */ -static inline void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc, +static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc, struct dpu_encoder_phys *phys, uint32_t extra_flush_bits) { struct dpu_hw_ctl *ctl; @@ -1419,7 +1419,7 @@ static inline void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc, * _dpu_encoder_trigger_start - trigger start for a physical encoder * phys: Pointer to physical encoder structure */ -static inline void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys) +static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys) { if (!phys) { DPU_ERROR("invalid argument(s)\n"); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 283a2491f3e3..b3c68c4fcc8e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -110,7 +110,7 @@ static void drm_mode_to_intf_timing_params( */ } -static inline u32 get_horizontal_total(const struct intf_timing_params *timing) +static u32 get_horizontal_total(const struct intf_timing_params *timing) { u32 active = timing->xres; u32 inactive = @@ -119,7 +119,7 @@ static inline u32 get_horizontal_total(const struct intf_timing_params *timing) return active + inactive; } -static inline u32 get_vertical_total(const struct intf_timing_params *timing) +static u32 get_vertical_total(const struct intf_timing_params *timing) { u32 active = timing->yres; u32 inactive = diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c index b394a1818c5d..cd27ba42efab 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c @@ -114,7 +114,7 @@ static inline u32 dpu_hw_ctl_get_flush_register(struct dpu_hw_ctl *ctx) return DPU_REG_READ(c, CTL_FLUSH); } -static inline uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx, +static uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx, enum dpu_sspp sspp) { uint32_t flushbits = 0; @@ -169,7 +169,7 @@ static inline uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx, return flushbits; } -static inline uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx, +static uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx, enum dpu_lm lm) { uint32_t flushbits = 0; @@ -202,7 +202,7 @@ static inline uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx, return flushbits; } -static inline int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx, +static int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx, u32 *flushbits, enum dpu_intf intf) { switch (intf) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c index acb8dc8acaa5..dbe48e006414 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c @@ -64,16 +64,10 @@ static struct dpu_lm_cfg *_lm_offset(enum dpu_lm mixer, static inline int _stage_offset(struct dpu_hw_mixer *ctx, enum dpu_stage stage) { const struct dpu_lm_sub_blks *sblk = ctx->cap->sblk; - int rc; - - if (stage == DPU_STAGE_BASE) - rc = -EINVAL; - else if (stage <= sblk->maxblendstages) - rc = sblk->blendstage_base[stage - DPU_STAGE_0]; - else - rc = -EINVAL; + if (stage != DPU_STAGE_BASE && stage <= sblk->maxblendstages) + return sblk->blendstage_base[stage - DPU_STAGE_0]; - return rc; + return -EINVAL; } static void dpu_hw_lm_setup_out(struct dpu_hw_mixer *ctx, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c index c25b52a6b219..8745018ffdd6 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c @@ -141,7 +141,7 @@ /* traffic shaper clock in Hz */ #define TS_CLK 19200000 -static inline int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, +static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, int s_id, u32 *idx) { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 1ce76460d710..2b23b95f4a6f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -140,7 +140,7 @@ static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane) * @src_wdith: width of source buffer * Return: fill level corresponding to the source buffer/format or 0 if error */ -static inline int _dpu_plane_calc_fill_level(struct drm_plane *plane, +static int _dpu_plane_calc_fill_level(struct drm_plane *plane, const struct dpu_format *fmt, u32 src_width) { struct dpu_plane *pdpu, *tmp; @@ -559,7 +559,7 @@ static int _dpu_plane_get_aspace( return 0; } -static inline void _dpu_plane_set_scanout(struct drm_plane *plane, +static void _dpu_plane_set_scanout(struct drm_plane *plane, struct dpu_plane_state *pstate, struct dpu_hw_pipe_cfg *pipe_cfg, struct drm_framebuffer *fb) @@ -671,7 +671,7 @@ static void _dpu_plane_setup_scaler3(struct dpu_plane *pdpu, scale_cfg->enable = 1; } -static inline void _dpu_plane_setup_csc(struct dpu_plane *pdpu) +static void _dpu_plane_setup_csc(struct dpu_plane *pdpu) { static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = { { diff --git a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h index 1a35dfb4a4e5..75470ee5b18f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h +++ b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h @@ -820,7 +820,7 @@ enum color_fmts { * Progressive: width * Interlaced: width */ -static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) +static unsigned int VENUS_Y_STRIDE(int color_fmt, int width) { unsigned int alignment, stride = 0; @@ -862,7 +862,7 @@ static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) * Progressive: width * Interlaced: width */ -static inline unsigned int VENUS_UV_STRIDE(int color_fmt, int width) +static unsigned int VENUS_UV_STRIDE(int color_fmt, int width) { unsigned int alignment, stride = 0; @@ -904,7 +904,7 @@ static inline unsigned int VENUS_UV_STRIDE(int color_fmt, int width) * Progressive: height * Interlaced: (height+1)>>1 */ -static inline unsigned int VENUS_Y_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_Y_SCANLINES(int color_fmt, int height) { unsigned int alignment, sclines = 0; @@ -938,7 +938,7 @@ static inline unsigned int VENUS_Y_SCANLINES(int color_fmt, int height) * Progressive: height * Interlaced: (height+1)>>1 */ -static inline unsigned int VENUS_UV_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_UV_SCANLINES(int color_fmt, int height) { unsigned int alignment, sclines = 0; @@ -974,7 +974,7 @@ static inline unsigned int VENUS_UV_SCANLINES(int color_fmt, int height) * Progressive: width * Interlaced: width */ -static inline unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width) +static unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width) { int y_tile_width = 0, y_meta_stride = 0; @@ -1007,7 +1007,7 @@ static inline unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width) * Progressive: height * Interlaced: (height+1)>>1 */ -static inline unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height) { int y_tile_height = 0, y_meta_scanlines = 0; @@ -1040,7 +1040,7 @@ static inline unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height) * Progressive: width * Interlaced: width */ -static inline unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width) +static unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width) { int uv_tile_width = 0, uv_meta_stride = 0; @@ -1073,7 +1073,7 @@ static inline unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width) * Progressive: height * Interlaced: (height+1)>>1 */ -static inline unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height) { int uv_tile_height = 0, uv_meta_scanlines = 0; @@ -1099,7 +1099,7 @@ static inline unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height) return uv_meta_scanlines; } -static inline unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) +static unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) { unsigned int alignment = 0, stride = 0, bpp = 4; @@ -1128,7 +1128,7 @@ static inline unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) return stride; } -static inline unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height) { unsigned int alignment = 0, scanlines = 0; @@ -1154,7 +1154,7 @@ static inline unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height) return scanlines; } -static inline unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width) +static unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width) { int rgb_tile_width = 0, rgb_meta_stride = 0; @@ -1178,7 +1178,7 @@ static inline unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width) return rgb_meta_stride; } -static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height) +static unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int height) { int rgb_tile_height = 0, rgb_meta_scanlines = 0; -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-5-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 4/6] drm/msm: dpu: Remove 'inline' from several functions [not found] ` <20180920145818.32468-5-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:29 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:29 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > Per chapter 15 of coding-style, removing 'inline' keyword from > functions > that are larger than a typical macro. In a couple of cases I've > simplified the function and kept the inline. > > Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 4 ++-- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h | 16 ++----------- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- > .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 ++-- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 6 ++--- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c | 12 +++------- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 2 +- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 6 ++--- > .../gpu/drm/msm/disp/dpu1/msm_media_info.h | 24 +++++++++---------- > 9 files changed, 30 insertions(+), 48 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > index a8f2dd7a37c7..5ff23f00582b 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > @@ -53,7 +53,7 @@ static inline int _dpu_crtc_get_mixer_width(struct > dpu_crtc_state *cstate, > return mode->hdisplay / cstate->num_mixers; > } > > -static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) > +static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) > { > struct msm_drm_private *priv; > > @@ -70,7 +70,7 @@ static inline struct dpu_kms > *_dpu_crtc_get_kms(struct > drm_crtc *crtc) > return to_dpu_kms(priv->kms); > } > > -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, > bool > enable) > +static int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool > enable) > { > struct drm_crtc *crtc; > struct msm_drm_private *priv; > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h > b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h > index 3723b4830335..cc18eca8f527 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h > @@ -266,13 +266,7 @@ static inline int dpu_crtc_get_mixer_height(struct > dpu_crtc *dpu_crtc, > */ > static inline int dpu_crtc_frame_pending(struct drm_crtc *crtc) > { > - struct dpu_crtc *dpu_crtc; > - > - if (!crtc) > - return -EINVAL; > - > - dpu_crtc = to_dpu_crtc(crtc); > - return atomic_read(&dpu_crtc->frame_pending); > + return crtc ? atomic_read(&to_dpu_crtc(crtc)->frame_pending) : > -EINVAL; > } > > /** > @@ -329,13 +323,7 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct > drm_crtc *crtc); > static inline enum dpu_crtc_client_type dpu_crtc_get_client_type( > struct drm_crtc *crtc) > { > - struct dpu_crtc_state *cstate = > - crtc ? to_dpu_crtc_state(crtc->state) : NULL; > - > - if (!cstate) > - return NRT_CLIENT; > - > - return RT_CLIENT; > + return crtc && crtc->state ? RT_CLIENT : NRT_CLIENT; > } > > /** > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 1f7f3c2e09c2..79a6c6b7350b 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -1376,7 +1376,7 @@ static void dpu_encoder_off_work(struct > kthread_work > *work) > * phys: Pointer to physical encoder structure > * extra_flush_bits: Additional bit mask to include in flush trigger > */ > -static inline void _dpu_encoder_trigger_flush(struct drm_encoder > *drm_enc, > +static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc, > struct dpu_encoder_phys *phys, uint32_t extra_flush_bits) > { > struct dpu_hw_ctl *ctl; > @@ -1419,7 +1419,7 @@ static inline void > _dpu_encoder_trigger_flush(struct > drm_encoder *drm_enc, > * _dpu_encoder_trigger_start - trigger start for a physical encoder > * phys: Pointer to physical encoder structure > */ > -static inline void _dpu_encoder_trigger_start(struct dpu_encoder_phys > *phys) > +static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys) > { > if (!phys) { > DPU_ERROR("invalid argument(s)\n"); > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > index 283a2491f3e3..b3c68c4fcc8e 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > @@ -110,7 +110,7 @@ static void drm_mode_to_intf_timing_params( > */ > } > > -static inline u32 get_horizontal_total(const struct intf_timing_params > *timing) > +static u32 get_horizontal_total(const struct intf_timing_params > *timing) > { > u32 active = timing->xres; > u32 inactive = > @@ -119,7 +119,7 @@ static inline u32 get_horizontal_total(const struct > intf_timing_params *timing) > return active + inactive; > } > > -static inline u32 get_vertical_total(const struct intf_timing_params > *timing) > +static u32 get_vertical_total(const struct intf_timing_params *timing) > { > u32 active = timing->yres; > u32 inactive = > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > index b394a1818c5d..cd27ba42efab 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c > @@ -114,7 +114,7 @@ static inline u32 > dpu_hw_ctl_get_flush_register(struct > dpu_hw_ctl *ctx) > return DPU_REG_READ(c, CTL_FLUSH); > } > > -static inline uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl > *ctx, > +static uint32_t dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx, > enum dpu_sspp sspp) > { > uint32_t flushbits = 0; > @@ -169,7 +169,7 @@ static inline uint32_t > dpu_hw_ctl_get_bitmask_sspp(struct dpu_hw_ctl *ctx, > return flushbits; > } > > -static inline uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl > *ctx, > +static uint32_t dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx, > enum dpu_lm lm) > { > uint32_t flushbits = 0; > @@ -202,7 +202,7 @@ static inline uint32_t > dpu_hw_ctl_get_bitmask_mixer(struct dpu_hw_ctl *ctx, > return flushbits; > } > > -static inline int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx, > +static int dpu_hw_ctl_get_bitmask_intf(struct dpu_hw_ctl *ctx, > u32 *flushbits, enum dpu_intf intf) > { > switch (intf) { > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c > index acb8dc8acaa5..dbe48e006414 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c > @@ -64,16 +64,10 @@ static struct dpu_lm_cfg *_lm_offset(enum dpu_lm > mixer, > static inline int _stage_offset(struct dpu_hw_mixer *ctx, enum > dpu_stage > stage) > { > const struct dpu_lm_sub_blks *sblk = ctx->cap->sblk; > - int rc; > - > - if (stage == DPU_STAGE_BASE) > - rc = -EINVAL; > - else if (stage <= sblk->maxblendstages) > - rc = sblk->blendstage_base[stage - DPU_STAGE_0]; > - else > - rc = -EINVAL; > + if (stage != DPU_STAGE_BASE && stage <= sblk->maxblendstages) > + return sblk->blendstage_base[stage - DPU_STAGE_0]; > > - return rc; > + return -EINVAL; > } > > static void dpu_hw_lm_setup_out(struct dpu_hw_mixer *ctx, > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c > index c25b52a6b219..8745018ffdd6 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c > @@ -141,7 +141,7 @@ > /* traffic shaper clock in Hz */ > #define TS_CLK 19200000 > > -static inline int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, > +static int _sspp_subblk_offset(struct dpu_hw_pipe *ctx, > int s_id, > u32 *idx) > { > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index 1ce76460d710..2b23b95f4a6f 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -140,7 +140,7 @@ static struct dpu_kms *_dpu_plane_get_kms(struct > drm_plane *plane) > * @src_wdith: width of source buffer > * Return: fill level corresponding to the source buffer/format or 0 > if > error > */ > -static inline int _dpu_plane_calc_fill_level(struct drm_plane *plane, > +static int _dpu_plane_calc_fill_level(struct drm_plane *plane, > const struct dpu_format *fmt, u32 src_width) > { > struct dpu_plane *pdpu, *tmp; > @@ -559,7 +559,7 @@ static int _dpu_plane_get_aspace( > return 0; > } > > -static inline void _dpu_plane_set_scanout(struct drm_plane *plane, > +static void _dpu_plane_set_scanout(struct drm_plane *plane, > struct dpu_plane_state *pstate, > struct dpu_hw_pipe_cfg *pipe_cfg, > struct drm_framebuffer *fb) > @@ -671,7 +671,7 @@ static void _dpu_plane_setup_scaler3(struct > dpu_plane > *pdpu, > scale_cfg->enable = 1; > } > > -static inline void _dpu_plane_setup_csc(struct dpu_plane *pdpu) > +static void _dpu_plane_setup_csc(struct dpu_plane *pdpu) > { > static const struct dpu_csc_cfg dpu_csc_YUV2RGB_601L = { > { > diff --git a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > index 1a35dfb4a4e5..75470ee5b18f 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/msm_media_info.h > @@ -820,7 +820,7 @@ enum color_fmts { > * Progressive: width > * Interlaced: width > */ > -static inline unsigned int VENUS_Y_STRIDE(int color_fmt, int width) > +static unsigned int VENUS_Y_STRIDE(int color_fmt, int width) > { > unsigned int alignment, stride = 0; > > @@ -862,7 +862,7 @@ static inline unsigned int VENUS_Y_STRIDE(int > color_fmt, int width) > * Progressive: width > * Interlaced: width > */ > -static inline unsigned int VENUS_UV_STRIDE(int color_fmt, int width) > +static unsigned int VENUS_UV_STRIDE(int color_fmt, int width) > { > unsigned int alignment, stride = 0; > > @@ -904,7 +904,7 @@ static inline unsigned int VENUS_UV_STRIDE(int > color_fmt, int width) > * Progressive: height > * Interlaced: (height+1)>>1 > */ > -static inline unsigned int VENUS_Y_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_Y_SCANLINES(int color_fmt, int height) > { > unsigned int alignment, sclines = 0; > > @@ -938,7 +938,7 @@ static inline unsigned int VENUS_Y_SCANLINES(int > color_fmt, int height) > * Progressive: height > * Interlaced: (height+1)>>1 > */ > -static inline unsigned int VENUS_UV_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_UV_SCANLINES(int color_fmt, int height) > { > unsigned int alignment, sclines = 0; > > @@ -974,7 +974,7 @@ static inline unsigned int VENUS_UV_SCANLINES(int > color_fmt, int height) > * Progressive: width > * Interlaced: width > */ > -static inline unsigned int VENUS_Y_META_STRIDE(int color_fmt, int > width) > +static unsigned int VENUS_Y_META_STRIDE(int color_fmt, int width) > { > int y_tile_width = 0, y_meta_stride = 0; > > @@ -1007,7 +1007,7 @@ static inline unsigned int > VENUS_Y_META_STRIDE(int > color_fmt, int width) > * Progressive: height > * Interlaced: (height+1)>>1 > */ > -static inline unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_Y_META_SCANLINES(int color_fmt, int height) > { > int y_tile_height = 0, y_meta_scanlines = 0; > > @@ -1040,7 +1040,7 @@ static inline unsigned int > VENUS_Y_META_SCANLINES(int color_fmt, int height) > * Progressive: width > * Interlaced: width > */ > -static inline unsigned int VENUS_UV_META_STRIDE(int color_fmt, int > width) > +static unsigned int VENUS_UV_META_STRIDE(int color_fmt, int width) > { > int uv_tile_width = 0, uv_meta_stride = 0; > > @@ -1073,7 +1073,7 @@ static inline unsigned int > VENUS_UV_META_STRIDE(int > color_fmt, int width) > * Progressive: height > * Interlaced: (height+1)>>1 > */ > -static inline unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_UV_META_SCANLINES(int color_fmt, int height) > { > int uv_tile_height = 0, uv_meta_scanlines = 0; > > @@ -1099,7 +1099,7 @@ static inline unsigned int > VENUS_UV_META_SCANLINES(int color_fmt, int height) > return uv_meta_scanlines; > } > > -static inline unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) > +static unsigned int VENUS_RGB_STRIDE(int color_fmt, int width) > { > unsigned int alignment = 0, stride = 0, bpp = 4; > > @@ -1128,7 +1128,7 @@ static inline unsigned int VENUS_RGB_STRIDE(int > color_fmt, int width) > return stride; > } > > -static inline unsigned int VENUS_RGB_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_RGB_SCANLINES(int color_fmt, int height) > { > unsigned int alignment = 0, scanlines = 0; > > @@ -1154,7 +1154,7 @@ static inline unsigned int > VENUS_RGB_SCANLINES(int > color_fmt, int height) > return scanlines; > } > > -static inline unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int > width) > +static unsigned int VENUS_RGB_META_STRIDE(int color_fmt, int width) > { > int rgb_tile_width = 0, rgb_meta_stride = 0; > > @@ -1178,7 +1178,7 @@ static inline unsigned int > VENUS_RGB_META_STRIDE(int > color_fmt, int width) > return rgb_meta_stride; > } > > -static inline unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int > height) > +static unsigned int VENUS_RGB_META_SCANLINES(int color_fmt, int > height) > { > int rgb_tile_height = 0, rgb_meta_scanlines = 0; -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> ` (3 preceding siblings ...) 2018-09-20 14:58 ` [PATCH 4/6] drm/msm: dpu: Remove 'inline' from several functions Sean Paul @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-6-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 2018-09-20 14:58 ` [PATCH 6/6] drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() Sean Paul 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> I noticed an empty label while driving by and decided to use coccinelle to see if there were any more. Here's the spatch and the invocation: --- @@ identifier lbl; expression E; @@ - goto lbl; + return E; ... - lbl: return E; @@ identifier lbl; @@ - goto lbl; + return; ... - lbl: - return; --- spatch --allow-inconsistent-paths --sp-file file.spatch --dir drivers/gpu/drm/msm/disp/dpu1 --in-place --- Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 5 ++--- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 ++------ drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 5 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 15 ++++++--------- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 ++++++-------- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 4 +--- 7 files changed, 20 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 41c5191f9056..affc9738e2b5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -68,7 +68,7 @@ static bool _dpu_core_video_mode_intf_connected(struct drm_crtc *crtc) bool intf_connected = false; if (!crtc) - goto end; + return intf_connected; drm_for_each_crtc(tmp_crtc, crtc->dev) { if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) && @@ -76,11 +76,10 @@ static bool _dpu_core_video_mode_intf_connected(struct drm_crtc *crtc) DPU_DEBUG("video interface connected crtc:%d\n", tmp_crtc->base.id); intf_connected = true; - goto end; + return intf_connected; } } -end: return intf_connected; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index c30ae05b3349..24a98f4e1f44 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -496,14 +496,11 @@ static void dpu_encoder_phys_cmd_enable_helper( _dpu_encoder_phys_cmd_pingpong_config(phys_enc); if (!dpu_encoder_phys_cmd_is_master(phys_enc)) - goto skip_flush; + return; ctl = phys_enc->hw_ctl; ctl->ops.get_bitmask_intf(ctl, &flush_mask, phys_enc->intf_idx); ctl->ops.update_pending_flush(ctl, flush_mask); - -skip_flush: - return; } static void dpu_encoder_phys_cmd_enable(struct dpu_encoder_phys *phys_enc) @@ -797,7 +794,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init( if (!cmd_enc) { ret = -ENOMEM; DPU_ERROR("failed to allocate\n"); - goto fail; + return ERR_PTR(ret); } phys_enc = &cmd_enc->base; phys_enc->hw_mdptop = p->dpu_kms->hw_mdp; @@ -855,6 +852,5 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init( return phys_enc; -fail: return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c index bfcd165e96df..0aa9b8e1ae70 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c @@ -921,7 +921,7 @@ static int _dpu_format_populate_addrs_ubwc( + layout->plane_size[2] + layout->plane_size[3]; if (!meta) - goto done; + return 0; /* configure Y metadata plane */ layout->plane_addr[2] = base_addr; @@ -952,12 +952,11 @@ static int _dpu_format_populate_addrs_ubwc( layout->plane_addr[1] = 0; if (!meta) - goto done; + return 0; layout->plane_addr[2] = base_addr; layout->plane_addr[3] = 0; } -done: return 0; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c index cc3a623903f4..52fca13da176 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c @@ -177,7 +177,7 @@ static u32 dpu_hw_pp_get_line_count(struct dpu_hw_pingpong *pp) height = DPU_REG_READ(c, PP_SYNC_CONFIG_HEIGHT) & 0xFFFF; if (height < init) - goto line_count_exit; + return line; line = DPU_REG_READ(c, PP_INT_COUNT_VAL) & 0xFFFF; @@ -186,7 +186,6 @@ static u32 dpu_hw_pp_get_line_count(struct dpu_hw_pingpong *pp) else line -= init; -line_count_exit: return line; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 0a683e65a9f3..d51992014e41 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -979,20 +979,20 @@ static int dpu_kms_hw_init(struct msm_kms *kms) if (!kms) { DPU_ERROR("invalid kms\n"); - goto end; + return rc; } dpu_kms = to_dpu_kms(kms); dev = dpu_kms->dev; if (!dev) { DPU_ERROR("invalid device\n"); - goto end; + return rc; } rc = dpu_dbg_init(&dpu_kms->pdev->dev); if (rc) { DRM_ERROR("failed to init dpu dbg: %d\n", rc); - goto end; + return rc; } priv = dev->dev_private; @@ -1173,7 +1173,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms) _dpu_kms_hw_destroy(dpu_kms); dbg_destroy: dpu_dbg_destroy(); -end: return rc; } @@ -1278,7 +1277,7 @@ static int __maybe_unused dpu_runtime_suspend(struct device *dev) ddev = dpu_kms->dev; if (!ddev) { DPU_ERROR("invalid drm_device\n"); - goto exit; + return rc; } rc = dpu_power_resource_enable(&dpu_kms->phandle, @@ -1290,7 +1289,6 @@ static int __maybe_unused dpu_runtime_suspend(struct device *dev) if (rc) DPU_ERROR("clock disable failed rc:%d\n", rc); -exit: return rc; } @@ -1305,13 +1303,13 @@ static int __maybe_unused dpu_runtime_resume(struct device *dev) ddev = dpu_kms->dev; if (!ddev) { DPU_ERROR("invalid drm_device\n"); - goto exit; + return rc; } rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); if (rc) { DPU_ERROR("clock enable failed rc:%d\n", rc); - goto exit; + return rc; } rc = dpu_power_resource_enable(&dpu_kms->phandle, @@ -1319,7 +1317,6 @@ static int __maybe_unused dpu_runtime_resume(struct device *dev) if (rc) DPU_ERROR("resource enable failed: %d\n", rc); -exit: return rc; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 2b23b95f4a6f..1fa0ba0019ed 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -432,13 +432,12 @@ int dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable) pdpu = to_dpu_plane(plane); if (!pdpu->is_rt_pipe) - goto end; + return 0; pm_runtime_get_sync(&dpu_kms->pdev->dev); _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL); pm_runtime_put_sync(&dpu_kms->pdev->dev); -end: return 0; } @@ -1744,24 +1743,24 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, if (!dev) { DPU_ERROR("[%u]device is NULL\n", pipe); - goto exit; + return ERR_PTR(ret); } priv = dev->dev_private; if (!priv) { DPU_ERROR("[%u]private data is NULL\n", pipe); - goto exit; + return ERR_PTR(ret); } if (!priv->kms) { DPU_ERROR("[%u]invalid KMS reference\n", pipe); - goto exit; + return ERR_PTR(ret); } kms = to_dpu_kms(priv->kms); if (!kms->catalog) { DPU_ERROR("[%u]invalid catalog reference\n", pipe); - goto exit; + return ERR_PTR(ret); } /* create and zero local structure */ @@ -1769,7 +1768,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, if (!pdpu) { DPU_ERROR("[%u]failed to allocate local plane struct\n", pipe); ret = -ENOMEM; - goto exit; + return ERR_PTR(ret); } /* cache local stuff for later */ @@ -1855,6 +1854,5 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev, dpu_hw_sspp_destroy(pdpu->pipe_hw); clean_plane: kfree(pdpu); -exit: return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c index 295528292296..ff5091d2555d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c @@ -191,7 +191,7 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, ot_lim = _dpu_vbif_get_ot_limit(vbif, params) & 0xFF; if (ot_lim == 0) - goto exit; + return; trace_dpu_perf_set_ot(params->num, params->xin_id, ot_lim, params->vbif_idx); @@ -210,8 +210,6 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, if (forced_on) mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, false); -exit: - return; } void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-6-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels [not found] ` <20180920145818.32468-6-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:24 ` Jeykumar Sankaran [not found] ` <f27fd1ba508b4b3efdd17b31971d37c7-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> 0 siblings, 1 reply; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:24 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > I noticed an empty label while driving by and decided to use > coccinelle to see if there were any more. Here's the spatch and the > invocation: > > --- > > @@ > identifier lbl; > expression E; > @@ > > - goto lbl; > + return E; > ... > - lbl: > return E; > > @@ > identifier lbl; > @@ > > - goto lbl; > + return; > ... > - lbl: > - return; > > --- > spatch --allow-inconsistent-paths --sp-file file.spatch --dir > drivers/gpu/drm/msm/disp/dpu1 --in-place > --- > > Signed-off-by: Sean Paul <seanpaul@chromium.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 5 ++--- > .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 ++------ > drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 5 ++--- > drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 3 +-- > drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 15 ++++++--------- > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 ++++++-------- > drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 4 +--- > 7 files changed, 20 insertions(+), 34 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > index 41c5191f9056..affc9738e2b5 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > @@ -68,7 +68,7 @@ static bool > _dpu_core_video_mode_intf_connected(struct > drm_crtc *crtc) > bool intf_connected = false; > > if (!crtc) > - goto end; > + return intf_connected; This can be further cleaned up by removing this intermediate var. > > drm_for_each_crtc(tmp_crtc, crtc->dev) { > if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) > && > @@ -76,11 +76,10 @@ static bool > _dpu_core_video_mode_intf_connected(struct > drm_crtc *crtc) > DPU_DEBUG("video interface connected crtc:%d\n", > tmp_crtc->base.id); > intf_connected = true; > - goto end; > + return intf_connected; > } > } > > -end: > return intf_connected; > } > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > index c30ae05b3349..24a98f4e1f44 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c > @@ -496,14 +496,11 @@ static void dpu_encoder_phys_cmd_enable_helper( > _dpu_encoder_phys_cmd_pingpong_config(phys_enc); > > if (!dpu_encoder_phys_cmd_is_master(phys_enc)) > - goto skip_flush; > + return; > > ctl = phys_enc->hw_ctl; > ctl->ops.get_bitmask_intf(ctl, &flush_mask, phys_enc->intf_idx); > ctl->ops.update_pending_flush(ctl, flush_mask); > - > -skip_flush: > - return; > } > > static void dpu_encoder_phys_cmd_enable(struct dpu_encoder_phys > *phys_enc) > @@ -797,7 +794,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init( > if (!cmd_enc) { > ret = -ENOMEM; > DPU_ERROR("failed to allocate\n"); > - goto fail; > + return ERR_PTR(ret); > } > phys_enc = &cmd_enc->base; > phys_enc->hw_mdptop = p->dpu_kms->hw_mdp; > @@ -855,6 +852,5 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init( > > return phys_enc; > > -fail: > return ERR_PTR(ret); > } > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c > index bfcd165e96df..0aa9b8e1ae70 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c > @@ -921,7 +921,7 @@ static int _dpu_format_populate_addrs_ubwc( > + layout->plane_size[2] + layout->plane_size[3]; > > if (!meta) > - goto done; > + return 0; > > /* configure Y metadata plane */ > layout->plane_addr[2] = base_addr; > @@ -952,12 +952,11 @@ static int _dpu_format_populate_addrs_ubwc( > layout->plane_addr[1] = 0; > > if (!meta) > - goto done; > + return 0; > > layout->plane_addr[2] = base_addr; > layout->plane_addr[3] = 0; > } > -done: > return 0; > } > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c > index cc3a623903f4..52fca13da176 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c > @@ -177,7 +177,7 @@ static u32 dpu_hw_pp_get_line_count(struct > dpu_hw_pingpong *pp) > height = DPU_REG_READ(c, PP_SYNC_CONFIG_HEIGHT) & 0xFFFF; > > if (height < init) > - goto line_count_exit; > + return line; > > line = DPU_REG_READ(c, PP_INT_COUNT_VAL) & 0xFFFF; > > @@ -186,7 +186,6 @@ static u32 dpu_hw_pp_get_line_count(struct > dpu_hw_pingpong *pp) > else > line -= init; > > -line_count_exit: > return line; > } > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > index 0a683e65a9f3..d51992014e41 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c > @@ -979,20 +979,20 @@ static int dpu_kms_hw_init(struct msm_kms *kms) > > if (!kms) { > DPU_ERROR("invalid kms\n"); > - goto end; > + return rc; > } > > dpu_kms = to_dpu_kms(kms); > dev = dpu_kms->dev; > if (!dev) { > DPU_ERROR("invalid device\n"); > - goto end; > + return rc; > } > > rc = dpu_dbg_init(&dpu_kms->pdev->dev); > if (rc) { > DRM_ERROR("failed to init dpu dbg: %d\n", rc); > - goto end; > + return rc; > } > > priv = dev->dev_private; > @@ -1173,7 +1173,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms) > _dpu_kms_hw_destroy(dpu_kms); > dbg_destroy: > dpu_dbg_destroy(); > -end: > return rc; > } > > @@ -1278,7 +1277,7 @@ static int __maybe_unused > dpu_runtime_suspend(struct > device *dev) > ddev = dpu_kms->dev; > if (!ddev) { > DPU_ERROR("invalid drm_device\n"); > - goto exit; > + return rc; > } > > rc = dpu_power_resource_enable(&dpu_kms->phandle, > @@ -1290,7 +1289,6 @@ static int __maybe_unused > dpu_runtime_suspend(struct > device *dev) > if (rc) > DPU_ERROR("clock disable failed rc:%d\n", rc); > > -exit: > return rc; > } > > @@ -1305,13 +1303,13 @@ static int __maybe_unused > dpu_runtime_resume(struct device *dev) > ddev = dpu_kms->dev; > if (!ddev) { > DPU_ERROR("invalid drm_device\n"); > - goto exit; > + return rc; > } > > rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); > if (rc) { > DPU_ERROR("clock enable failed rc:%d\n", rc); > - goto exit; > + return rc; > } > > rc = dpu_power_resource_enable(&dpu_kms->phandle, > @@ -1319,7 +1317,6 @@ static int __maybe_unused > dpu_runtime_resume(struct > device *dev) > if (rc) > DPU_ERROR("resource enable failed: %d\n", rc); > > -exit: > return rc; > } > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > index 2b23b95f4a6f..1fa0ba0019ed 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > @@ -432,13 +432,12 @@ int dpu_plane_danger_signal_ctrl(struct drm_plane > *plane, bool enable) > pdpu = to_dpu_plane(plane); > > if (!pdpu->is_rt_pipe) > - goto end; > + return 0; > > pm_runtime_get_sync(&dpu_kms->pdev->dev); > _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL); > pm_runtime_put_sync(&dpu_kms->pdev->dev); > > -end: > return 0; > } > > @@ -1744,24 +1743,24 @@ struct drm_plane *dpu_plane_init(struct > drm_device > *dev, > > if (!dev) { > DPU_ERROR("[%u]device is NULL\n", pipe); > - goto exit; > + return ERR_PTR(ret); > } > > priv = dev->dev_private; > if (!priv) { > DPU_ERROR("[%u]private data is NULL\n", pipe); > - goto exit; > + return ERR_PTR(ret); > } > > if (!priv->kms) { > DPU_ERROR("[%u]invalid KMS reference\n", pipe); > - goto exit; > + return ERR_PTR(ret); > } > kms = to_dpu_kms(priv->kms); > > if (!kms->catalog) { > DPU_ERROR("[%u]invalid catalog reference\n", pipe); > - goto exit; > + return ERR_PTR(ret); > } > > /* create and zero local structure */ > @@ -1769,7 +1768,7 @@ struct drm_plane *dpu_plane_init(struct > drm_device > *dev, > if (!pdpu) { > DPU_ERROR("[%u]failed to allocate local plane struct\n", > pipe); > ret = -ENOMEM; > - goto exit; > + return ERR_PTR(ret); > } > > /* cache local stuff for later */ > @@ -1855,6 +1854,5 @@ struct drm_plane *dpu_plane_init(struct > drm_device > *dev, > dpu_hw_sspp_destroy(pdpu->pipe_hw); > clean_plane: > kfree(pdpu); > -exit: > return ERR_PTR(ret); > } > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c > index 295528292296..ff5091d2555d 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c > @@ -191,7 +191,7 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, > ot_lim = _dpu_vbif_get_ot_limit(vbif, params) & 0xFF; > > if (ot_lim == 0) > - goto exit; > + return; > > trace_dpu_perf_set_ot(params->num, params->xin_id, ot_lim, > params->vbif_idx); > @@ -210,8 +210,6 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, > > if (forced_on) > mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, > false); > -exit: > - return; > } > > void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <f27fd1ba508b4b3efdd17b31971d37c7-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>]
* Re: [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels [not found] ` <f27fd1ba508b4b3efdd17b31971d37c7-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> @ 2018-10-08 22:30 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:30 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-10-08 15:24, Jeykumar Sankaran wrote: > On 2018-09-20 07:58, Sean Paul wrote: >> From: Sean Paul <seanpaul@chromium.org> >> >> I noticed an empty label while driving by and decided to use >> coccinelle to see if there were any more. Here's the spatch and the >> invocation: >> >> --- >> >> @@ >> identifier lbl; >> expression E; >> @@ >> >> - goto lbl; >> + return E; >> ... >> - lbl: >> return E; >> >> @@ >> identifier lbl; >> @@ >> >> - goto lbl; >> + return; >> ... >> - lbl: >> - return; >> >> --- >> spatch --allow-inconsistent-paths --sp-file file.spatch --dir >> drivers/gpu/drm/msm/disp/dpu1 --in-place >> --- >> >> Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> >> --- >> drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 5 ++--- >> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 ++------ >> drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 5 ++--- >> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 3 +-- >> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 15 >> ++++++--------- >> drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 14 ++++++-------- >> drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 4 +--- >> 7 files changed, 20 insertions(+), 34 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c >> index 41c5191f9056..affc9738e2b5 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c >> @@ -68,7 +68,7 @@ static bool >> _dpu_core_video_mode_intf_connected(struct >> drm_crtc *crtc) >> bool intf_connected = false; >> >> if (!crtc) >> - goto end; >> + return intf_connected; > This can be further cleaned up by removing this intermediate var. Nevermind. Just checked patch 6/6. >> >> drm_for_each_crtc(tmp_crtc, crtc->dev) { >> if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) >> && >> @@ -76,11 +76,10 @@ static bool >> _dpu_core_video_mode_intf_connected(struct >> drm_crtc *crtc) >> DPU_DEBUG("video interface connected crtc:%d\n", >> tmp_crtc->base.id); >> intf_connected = true; >> - goto end; >> + return intf_connected; >> } >> } >> >> -end: >> return intf_connected; >> } >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c >> index c30ae05b3349..24a98f4e1f44 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c >> @@ -496,14 +496,11 @@ static void dpu_encoder_phys_cmd_enable_helper( >> _dpu_encoder_phys_cmd_pingpong_config(phys_enc); >> >> if (!dpu_encoder_phys_cmd_is_master(phys_enc)) >> - goto skip_flush; >> + return; >> >> ctl = phys_enc->hw_ctl; >> ctl->ops.get_bitmask_intf(ctl, &flush_mask, phys_enc->intf_idx); >> ctl->ops.update_pending_flush(ctl, flush_mask); >> - >> -skip_flush: >> - return; >> } >> >> static void dpu_encoder_phys_cmd_enable(struct dpu_encoder_phys >> *phys_enc) >> @@ -797,7 +794,7 @@ struct dpu_encoder_phys >> *dpu_encoder_phys_cmd_init( >> if (!cmd_enc) { >> ret = -ENOMEM; >> DPU_ERROR("failed to allocate\n"); >> - goto fail; >> + return ERR_PTR(ret); >> } >> phys_enc = &cmd_enc->base; >> phys_enc->hw_mdptop = p->dpu_kms->hw_mdp; >> @@ -855,6 +852,5 @@ struct dpu_encoder_phys >> *dpu_encoder_phys_cmd_init( >> >> return phys_enc; >> >> -fail: >> return ERR_PTR(ret); >> } >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c >> index bfcd165e96df..0aa9b8e1ae70 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c >> @@ -921,7 +921,7 @@ static int _dpu_format_populate_addrs_ubwc( >> + layout->plane_size[2] + layout->plane_size[3]; >> >> if (!meta) >> - goto done; >> + return 0; >> >> /* configure Y metadata plane */ >> layout->plane_addr[2] = base_addr; >> @@ -952,12 +952,11 @@ static int _dpu_format_populate_addrs_ubwc( >> layout->plane_addr[1] = 0; >> >> if (!meta) >> - goto done; >> + return 0; >> >> layout->plane_addr[2] = base_addr; >> layout->plane_addr[3] = 0; >> } >> -done: >> return 0; >> } >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c >> index cc3a623903f4..52fca13da176 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c >> @@ -177,7 +177,7 @@ static u32 dpu_hw_pp_get_line_count(struct >> dpu_hw_pingpong *pp) >> height = DPU_REG_READ(c, PP_SYNC_CONFIG_HEIGHT) & 0xFFFF; >> >> if (height < init) >> - goto line_count_exit; >> + return line; >> >> line = DPU_REG_READ(c, PP_INT_COUNT_VAL) & 0xFFFF; >> >> @@ -186,7 +186,6 @@ static u32 dpu_hw_pp_get_line_count(struct >> dpu_hw_pingpong *pp) >> else >> line -= init; >> >> -line_count_exit: >> return line; >> } >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c >> index 0a683e65a9f3..d51992014e41 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c >> @@ -979,20 +979,20 @@ static int dpu_kms_hw_init(struct msm_kms *kms) >> >> if (!kms) { >> DPU_ERROR("invalid kms\n"); >> - goto end; >> + return rc; >> } >> >> dpu_kms = to_dpu_kms(kms); >> dev = dpu_kms->dev; >> if (!dev) { >> DPU_ERROR("invalid device\n"); >> - goto end; >> + return rc; >> } >> >> rc = dpu_dbg_init(&dpu_kms->pdev->dev); >> if (rc) { >> DRM_ERROR("failed to init dpu dbg: %d\n", rc); >> - goto end; >> + return rc; >> } >> >> priv = dev->dev_private; >> @@ -1173,7 +1173,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms) >> _dpu_kms_hw_destroy(dpu_kms); >> dbg_destroy: >> dpu_dbg_destroy(); >> -end: >> return rc; >> } >> >> @@ -1278,7 +1277,7 @@ static int __maybe_unused >> dpu_runtime_suspend(struct >> device *dev) >> ddev = dpu_kms->dev; >> if (!ddev) { >> DPU_ERROR("invalid drm_device\n"); >> - goto exit; >> + return rc; >> } >> >> rc = dpu_power_resource_enable(&dpu_kms->phandle, >> @@ -1290,7 +1289,6 @@ static int __maybe_unused >> dpu_runtime_suspend(struct >> device *dev) >> if (rc) >> DPU_ERROR("clock disable failed rc:%d\n", rc); >> >> -exit: >> return rc; >> } >> >> @@ -1305,13 +1303,13 @@ static int __maybe_unused >> dpu_runtime_resume(struct device *dev) >> ddev = dpu_kms->dev; >> if (!ddev) { >> DPU_ERROR("invalid drm_device\n"); >> - goto exit; >> + return rc; >> } >> >> rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); >> if (rc) { >> DPU_ERROR("clock enable failed rc:%d\n", rc); >> - goto exit; >> + return rc; >> } >> >> rc = dpu_power_resource_enable(&dpu_kms->phandle, >> @@ -1319,7 +1317,6 @@ static int __maybe_unused >> dpu_runtime_resume(struct >> device *dev) >> if (rc) >> DPU_ERROR("resource enable failed: %d\n", rc); >> >> -exit: >> return rc; >> } >> >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> index 2b23b95f4a6f..1fa0ba0019ed 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c >> @@ -432,13 +432,12 @@ int dpu_plane_danger_signal_ctrl(struct >> drm_plane >> *plane, bool enable) >> pdpu = to_dpu_plane(plane); >> >> if (!pdpu->is_rt_pipe) >> - goto end; >> + return 0; >> >> pm_runtime_get_sync(&dpu_kms->pdev->dev); >> _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL); >> pm_runtime_put_sync(&dpu_kms->pdev->dev); >> >> -end: >> return 0; >> } >> >> @@ -1744,24 +1743,24 @@ struct drm_plane *dpu_plane_init(struct >> drm_device >> *dev, >> >> if (!dev) { >> DPU_ERROR("[%u]device is NULL\n", pipe); >> - goto exit; >> + return ERR_PTR(ret); >> } >> >> priv = dev->dev_private; >> if (!priv) { >> DPU_ERROR("[%u]private data is NULL\n", pipe); >> - goto exit; >> + return ERR_PTR(ret); >> } >> >> if (!priv->kms) { >> DPU_ERROR("[%u]invalid KMS reference\n", pipe); >> - goto exit; >> + return ERR_PTR(ret); >> } >> kms = to_dpu_kms(priv->kms); >> >> if (!kms->catalog) { >> DPU_ERROR("[%u]invalid catalog reference\n", pipe); >> - goto exit; >> + return ERR_PTR(ret); >> } >> >> /* create and zero local structure */ >> @@ -1769,7 +1768,7 @@ struct drm_plane *dpu_plane_init(struct >> drm_device >> *dev, >> if (!pdpu) { >> DPU_ERROR("[%u]failed to allocate local plane struct\n", >> pipe); >> ret = -ENOMEM; >> - goto exit; >> + return ERR_PTR(ret); >> } >> >> /* cache local stuff for later */ >> @@ -1855,6 +1854,5 @@ struct drm_plane *dpu_plane_init(struct >> drm_device >> *dev, >> dpu_hw_sspp_destroy(pdpu->pipe_hw); >> clean_plane: >> kfree(pdpu); >> -exit: >> return ERR_PTR(ret); >> } >> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c >> b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c >> index 295528292296..ff5091d2555d 100644 >> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c >> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c >> @@ -191,7 +191,7 @@ void dpu_vbif_set_ot_limit(struct dpu_kms >> *dpu_kms, >> ot_lim = _dpu_vbif_get_ot_limit(vbif, params) & 0xFF; >> >> if (ot_lim == 0) >> - goto exit; >> + return; >> >> trace_dpu_perf_set_ot(params->num, params->xin_id, ot_lim, >> params->vbif_idx); >> @@ -210,8 +210,6 @@ void dpu_vbif_set_ot_limit(struct dpu_kms >> *dpu_kms, >> >> if (forced_on) >> mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, >> false); >> -exit: >> - return; >> } >> >> void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 6/6] drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() [not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> ` (4 preceding siblings ...) 2018-09-20 14:58 ` [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels Sean Paul @ 2018-09-20 14:58 ` Sean Paul [not found] ` <20180920145818.32468-7-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> 5 siblings, 1 reply; 14+ messages in thread From: Sean Paul @ 2018-09-20 14:58 UTC (permalink / raw) To: freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA Cc: jsanka-sgV2jX0FEOL9JmXXK+q4OQ, Sean Paul, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ From: Sean Paul <seanpaul@chromium.org> Local variable is not needed and condition can't be hit. Signed-off-by: Sean Paul <seanpaul@chromium.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index affc9738e2b5..22e84b3d7f98 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -65,22 +65,17 @@ static bool _dpu_core_perf_crtc_is_power_on(struct drm_crtc *crtc) static bool _dpu_core_video_mode_intf_connected(struct drm_crtc *crtc) { struct drm_crtc *tmp_crtc; - bool intf_connected = false; - - if (!crtc) - return intf_connected; drm_for_each_crtc(tmp_crtc, crtc->dev) { if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) && _dpu_core_perf_crtc_is_power_on(tmp_crtc)) { DPU_DEBUG("video interface connected crtc:%d\n", tmp_crtc->base.id); - intf_connected = true; - return intf_connected; + return true; } } - return intf_connected; + return false; } static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms, -- Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply related [flat|nested] 14+ messages in thread
[parent not found: <20180920145818.32468-7-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>]
* Re: [PATCH 6/6] drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() [not found] ` <20180920145818.32468-7-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org> @ 2018-10-08 22:28 ` Jeykumar Sankaran 0 siblings, 0 replies; 14+ messages in thread From: Jeykumar Sankaran @ 2018-10-08 22:28 UTC (permalink / raw) To: Sean Paul Cc: Sean Paul, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, abhinavk-sgV2jX0FEOL9JmXXK+q4OQ On 2018-09-20 07:58, Sean Paul wrote: > From: Sean Paul <seanpaul@chromium.org> > > Local variable is not needed and condition can't be hit. > > Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > index affc9738e2b5..22e84b3d7f98 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c > @@ -65,22 +65,17 @@ static bool _dpu_core_perf_crtc_is_power_on(struct > drm_crtc *crtc) > static bool _dpu_core_video_mode_intf_connected(struct drm_crtc *crtc) > { > struct drm_crtc *tmp_crtc; > - bool intf_connected = false; > - > - if (!crtc) > - return intf_connected; > > drm_for_each_crtc(tmp_crtc, crtc->dev) { > if ((dpu_crtc_get_intf_mode(tmp_crtc) == INTF_MODE_VIDEO) > && > _dpu_core_perf_crtc_is_power_on(tmp_crtc)) > { > DPU_DEBUG("video interface connected crtc:%d\n", > tmp_crtc->base.id); > - intf_connected = true; > - return intf_connected; > + return true; > } > } > > - return intf_connected; > + return false; > } > > static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms, -- Jeykumar S _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-10-08 22:30 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 14:58 [PATCH 0/6] drm/msm: dpu: Various cleanup patches Sean Paul
[not found] ` <20180920145818.32468-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-09-20 14:58 ` [PATCH 1/6] drm/msm: Remove dpu_encoder_phys_ops->hw_reset() Sean Paul
[not found] ` <20180920145818.32468-2-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:27 ` Jeykumar Sankaran
2018-09-20 14:58 ` [PATCH 2/6] drm/msm: dpu: Remove unused functions from msm_media_info.h Sean Paul
[not found] ` <20180920145818.32468-3-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:27 ` Jeykumar Sankaran
2018-09-20 14:58 ` [PATCH 3/6] drm/msm: dpu: Remove _dpu_encoder_power_enable() Sean Paul
[not found] ` <20180920145818.32468-4-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:27 ` Jeykumar Sankaran
2018-09-20 14:58 ` [PATCH 4/6] drm/msm: dpu: Remove 'inline' from several functions Sean Paul
[not found] ` <20180920145818.32468-5-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:29 ` Jeykumar Sankaran
2018-09-20 14:58 ` [PATCH 5/6] drm/msm: dpu: Remove empty/useless labels Sean Paul
[not found] ` <20180920145818.32468-6-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:24 ` Jeykumar Sankaran
[not found] ` <f27fd1ba508b4b3efdd17b31971d37c7-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-10-08 22:30 ` Jeykumar Sankaran
2018-09-20 14:58 ` [PATCH 6/6] drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() Sean Paul
[not found] ` <20180920145818.32468-7-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
2018-10-08 22:28 ` Jeykumar Sankaran
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).