drm/msm/dpu: cleanup dpu_core_perf module
v2 cover drm/msm/dpu: cleanup dpu_core_perf module
Apply several cleanups to the DPU's core_perf module.
Changes since v1:
- Reworked overrides for the perf parameters instead of completely dropping them. Abhinav described why these overrides are useful.
- Moved max clock rate determination to dpu_kms.c
Dmitry Baryshkov (14):
drm/msm/dpu: drop enum dpu_core_perf_data_bus_id drm/msm/dpu: core_perf: extract bandwidth aggregation function drm/msm/dpu: core_perf: bail earlier if there are no ICC paths drm/msm/dpu: drop separate dpu_core_perf_tune overrides drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus() drm/msm/dpu: rework core_perf debugfs overrides drm/msm/dpu: drop dpu_core_perf_params::max_per_pipe_ib drm/msm/dpu: rework indentation in dpu_core_perf drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code drm/msm/dpu: remove unused fields from struct dpu_core_perf drm/msm/dpu: core_perf: remove extra clk_round_rate() call drm/msm/dpu: move max clock decision to dpu_kms. drm/msm/dpu: drop dpu_core_perf_destroy()
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 265 +++++------------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 60 +--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 14 +- 4 files changed, 96 insertions(+), 251 deletions(-)
Signature · 1 line
2.39.2
PATCH v2 1/14 drm/msm/dpu: drop enum dpu_core_perf_data_bus_id
Drop the leftover of bus-client -> interconnect conversion, the enum dpu_core_perf_data_bus_id.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 13 ------------- 1 file changed, 13 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -13
@@ -14,19 +14,6 @@#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 -/** -* enum dpu_core_perf_data_bus_id - data bus identifier -* @DPU_CORE_PERF_DATA_BUS_ID_MNOC: DPU/MNOC data bus -* @DPU_CORE_PERF_DATA_BUS_ID_LLCC: MNOC/LLCC data bus -* @DPU_CORE_PERF_DATA_BUS_ID_EBI: LLCC/EBI data bus -*/ -enum dpu_core_perf_data_bus_id { -DPU_CORE_PERF_DATA_BUS_ID_MNOC , -DPU_CORE_PERF_DATA_BUS_ID_LLCC , -DPU_CORE_PERF_DATA_BUS_ID_EBI , -DPU_CORE_PERF_DATA_BUS_ID_MAX , -}; -/** * struct dpu_core_perf_params - definition of performance parameters * @max_per_pipe_ib: maximum instantaneous bandwidth request
Signature · 1 line
2.39.2
PATCH v2 2/14 drm/msm/dpu: core_perf: extract bandwidth aggregation function
In reply to Dmitry BaryshkovIn preparation to refactoring the dpu_core_perf debugfs interface, extract the bandwidth aggregation function from _dpu_core_perf_crtc_update_bus().
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +22 -17
@@ -206,33 +206,38 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,return 0 ; } -static int _dpu_core_perf_crtc_update_bus (struct dpu_kms *kms, -struct drm_crtc *crtc) +static void dpu_core_perf_aggregate (struct drm_device *ddev, +enum dpu_crtc_client_type curr_client_type, +struct dpu_core_perf_params *perf) { -struct dpu_core_perf_params perf = {0 }; -enum dpu_crtc_client_type curr_client_type - =dpu_crtc_get_client_type (crtc); -struct drm_crtc *tmp_crtc;struct dpu_crtc_state *dpu_cstate; -int i, ret =0 ; -u64 avg_bw; +struct drm_crtc *tmp_crtc; -drm_for_each_crtc (tmp_crtc, crtc->dev) { +drm_for_each_crtc (tmp_crtc, ddev) {if (tmp_crtc->enabled && - curr_client_type == -dpu_crtc_get_client_type (tmp_crtc)) { + curr_client_type ==dpu_crtc_get_client_type (tmp_crtc)) { dpu_cstate =to_dpu_crtc_state (tmp_crtc->state); - perf.max_per_pipe_ib =max (perf.max_per_pipe_ib, - dpu_cstate->new_perf.max_per_pipe_ib); + perf->max_per_pipe_ib =max (perf->max_per_pipe_ib, + dpu_cstate->new_perf.max_per_pipe_ib); - perf.bw_ctl += dpu_cstate->new_perf.bw_ctl; + perf->bw_ctl += dpu_cstate->new_perf.bw_ctl; -DRM_DEBUG_ATOMIC ("crtc=%d bw=%llu paths:%d\n" , - tmp_crtc->base.id, - dpu_cstate->new_perf.bw_ctl, kms->num_paths); +DRM_DEBUG_ATOMIC ("crtc=%d bw=%llu\n" , + tmp_crtc->base.id, + dpu_cstate->new_perf.bw_ctl); } } +} + +static int _dpu_core_perf_crtc_update_bus (struct dpu_kms *kms, +struct drm_crtc *crtc) +{ +struct dpu_core_perf_params perf = {0 }; +int i, ret =0 ; +u64 avg_bw; + +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf);if (!kms->num_paths)return 0 ;
Signature · 1 line
2.39.2
PATCH v2 3/14 drm/msm/dpu: core_perf: bail earlier if there are no ICC paths
In reply to Dmitry BaryshkovSkip bandwidth aggregation and return early if there are no interconnect paths defined for the DPU device.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +2 -2
@@ -237,11 +237,11 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,int i, ret =0 ;u64 avg_bw; -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); -if (!kms->num_paths)return 0 ; +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + avg_bw = perf.bw_ctl;do_div (avg_bw, (kms->num_paths *1000 ));/*Bps_to_icc*/
Signature · 1 line
2.39.2
PATCH v2 4/14 drm/msm/dpu: drop separate dpu_core_perf_tune overrides
In reply to Dmitry BaryshkovThe values in struct dpu_core_perf_tune are fixed per the core perf mode. Drop the 'tune' values and substitute them with known values when performing perf management.
Note: min_bus_vote was not used at all, so it is just silently dropped.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 29 ++++++++----------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 4 --- 2 files changed, 12 insertions(+), 21 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +12 -17
@@ -235,7 +235,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, {struct dpu_core_perf_params perf = {0 };int i, ret =0 ; -u64 avg_bw; +u32 avg_bw;if (!kms->num_paths)return 0 ;
@@ -291,10 +291,16 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc)static u64 _dpu_core_perf_get_core_clk_rate (struct dpu_kms *kms) { -u64 clk_rate = kms->perf.perf_tune.min_core_clk; +u64 clk_rate;struct drm_crtc *crtc;struct dpu_crtc_state *dpu_cstate; +if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) +return kms->perf.fix_core_clk_rate; + +if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) +return kms->perf.max_core_clk_rate; +drm_for_each_crtc (crtc, kms->dev) {if (crtc->enabled) { dpu_cstate =to_dpu_crtc_state (crtc->state);
@@ -305,11 +311,6 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) } } -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) - clk_rate = kms->perf.fix_core_clk_rate; - -DRM_DEBUG_ATOMIC ("clk:%llu\n" , clk_rate); -return clk_rate; }
@@ -397,6 +398,8 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,if (update_clk) { clk_rate =_dpu_core_perf_get_core_clk_rate (kms); +DRM_DEBUG_ATOMIC ("clk:%llu\n" , clk_rate); +trace_dpu_core_perf_update_clk (kms->dev, stop_req, clk_rate); clk_rate =min (clk_rate, kms->perf.max_core_clk_rate);
@@ -418,7 +421,6 @@ static ssize_t _dpu_core_perf_mode_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct dpu_core_perf *perf = file->private_data; -const struct dpu_perf_cfg *cfg = perf->catalog->perf;u32 perf_mode =0 ;int ret;
@@ -433,14 +435,9 @@ static ssize_t _dpu_core_perf_mode_write(struct file *file,DRM_INFO ("fix performance mode\n" ); }else if (perf_mode ==DPU_PERF_MODE_MINIMUM ) {/* run the driver with max clk and BW vote */ - perf->perf_tune.min_core_clk = perf->max_core_clk_rate; - perf->perf_tune.min_bus_vote = - (u64 ) cfg->max_bw_high *1000 ;DRM_INFO ("minimum performance mode\n" ); }else if (perf_mode ==DPU_PERF_MODE_NORMAL ) {/* reset the perf tune params to 0 */ - perf->perf_tune.min_core_clk =0 ; - perf->perf_tune.min_bus_vote =0 ;DRM_INFO ("normal performance mode\n" ); } perf->perf_tune.mode = perf_mode;
@@ -456,10 +453,8 @@ static ssize_t _dpu_core_perf_mode_read(struct file *file,char buf[128 ]; len =scnprintf (buf,sizeof (buf), -"mode %d min_mdp_clk %llu min_bus_vote %llu\n" , - perf->perf_tune.mode, - perf->perf_tune.min_core_clk, - perf->perf_tune.min_bus_vote); +"mode %d\n" , + perf->perf_tune.mode);return simple_read_from_buffer (buff, count, ppos, buf, len); }
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -4
@@ -29,13 +29,9 @@ struct dpu_core_perf_params {/** * struct dpu_core_perf_tune - definition of performance tuning control * @mode: performance mode -* @min_core_clk: minimum core clock -* @min_bus_vote: minimum bus vote */ struct dpu_core_perf_tune {u32 mode; -u64 min_core_clk; -u64 min_bus_vote; };/**
Signature · 1 line
2.39.2
PATCH v2 5/14 drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus()
In reply to Dmitry BaryshkovMove perf mode handling for the bandwidth to _dpu_core_perf_crtc_update_bus() rather than overriding per-CRTC data and then aggregating known values.
Note, this changes the fix_core_ab_vote. Previously it would be multiplied per the CRTC number, now it will be used directly for interconnect voting.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +18 -19
@@ -116,21 +116,9 @@ static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms,return ; } -memset (perf,0 ,sizeof (struct dpu_core_perf_params )); - -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { - perf->bw_ctl =0 ; - perf->max_per_pipe_ib =0 ; - perf->core_clk_rate =0 ; - }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { - perf->bw_ctl = kms->perf.fix_core_ab_vote; - perf->max_per_pipe_ib = kms->perf.fix_core_ib_vote; - perf->core_clk_rate = kms->perf.fix_core_clk_rate; - }else { - perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); - perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; - perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); - } + perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); + perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; + perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); DRM_DEBUG_ATOMIC( "crtc=%d clk_rate=%llu core_ib=%llu core_ab=%llu\n",
@@ -236,17 +224,28 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,struct dpu_core_perf_params perf = {0 };int i, ret =0 ;u32 avg_bw; +u32 peak_bw;if (!kms->num_paths)return 0 ; -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); +if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { + avg_bw =0 ; + peak_bw =0 ; + }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { + avg_bw = kms->perf.fix_core_ab_vote; + peak_bw = kms->perf.fix_core_ib_vote; + }else { +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + + avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ + peak_bw = perf.max_per_pipe_ib; + } - avg_bw = perf.bw_ctl; -do_div (avg_bw, (kms->num_paths *1000 ));/*Bps_to_icc*/ + avg_bw /= kms->num_paths;for (i =0 ; i < kms->num_paths; i++) -icc_set_bw (kms->path[i], avg_bw, perf.max_per_pipe_ib); +icc_set_bw (kms->path[i], avg_bw, peak_bw);return ret; }
Signature · 1 line
2.39.2
Re: [PATCH v2 05/14] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus()
Quoted 9 lines · Dmitry Baryshkov
Move perf mode handling for the bandwidth to
_dpu_core_perf_crtc_update_bus()rather than overriding per-CRTC data and then aggregating known values.Note, this changes the
fix_core_ab_vote. Previously it would be multiplied per the CRTC number, now it will be used directly for interconnect voting.Signed-off-by Dmitry Baryshkov <[email protected]>
Break this out into a separate series. This rework doesnt need to be part of this cleanup series.
Quoted 66 lines
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +18
-19@@ -116,21 +116,9 @@ static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms,return ; } -memset (perf,0 ,sizeof (struct dpu_core_perf_params )); - -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { - perf->bw_ctl =0 ; - perf->max_per_pipe_ib =0 ; - perf->core_clk_rate =0 ; - }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { - perf->bw_ctl = kms->perf.fix_core_ab_vote; - perf->max_per_pipe_ib = kms->perf.fix_core_ib_vote; - perf->core_clk_rate = kms->perf.fix_core_clk_rate; - }else { - perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); - perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; - perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); - } + perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); + perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; + perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); DRM_DEBUG_ATOMIC( "crtc=%d clk_rate=%llu core_ib=%llu core_ab=%llu\n",@@ -236,17 +224,28 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,struct dpu_core_perf_params perf = {0 };int i, ret =0 ;u32 avg_bw; +u32 peak_bw;if (!kms->num_paths)return 0 ; -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); +if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { + avg_bw =0 ; + peak_bw =0 ; + }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { + avg_bw = kms->perf.fix_core_ab_vote; + peak_bw = kms->perf.fix_core_ib_vote; + }else { +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + + avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ + peak_bw = perf.max_per_pipe_ib; + } - avg_bw = perf.bw_ctl; -do_div (avg_bw, (kms->num_paths *1000 ));/*Bps_to_icc*/ + avg_bw /= kms->num_paths;for (i =0 ; i < kms->num_paths; i++) -icc_set_bw (kms->path[i], avg_bw, perf.max_per_pipe_ib); +icc_set_bw (kms->path[i], avg_bw, peak_bw);return ret; }
Re: [PATCH v2 05/14] drm/msm/dpu: handle perf mode in _dpu_core_perf_crtc_update_bus()
Quoted 8 lines · Abhinav Kumar
Quoted 4 lines · Dmitry Baryshkov
Move perf mode handling for the bandwidth to
_dpu_core_perf_crtc_update_bus()rather than overriding per-CRTC data and then aggregating known values.
Quoted 8 lines
Quoted 5 lines
Note, this changes the
fix_core_ab_vote. Previously it would be multiplied per the CRTC number, now it will be used directly for interconnect voting.Signed-off-by Dmitry Baryshkov <[email protected]>Break this out into a separate series. This rework doesnt need to be part of this cleanup series.
Sure, why not.
Quoted 67 lines
Quoted 67 lines
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +18
-19@@ -116,21 +116,9 @@ static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms,return ; } -memset (perf,0 ,sizeof (struct dpu_core_perf_params )); - -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { - perf->bw_ctl =0 ; - perf->max_per_pipe_ib =0 ; - perf->core_clk_rate =0 ; - }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { - perf->bw_ctl = kms->perf.fix_core_ab_vote; - perf->max_per_pipe_ib = kms->perf.fix_core_ib_vote; - perf->core_clk_rate = kms->perf.fix_core_clk_rate; - }else { - perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); - perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; - perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); - } + perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); + perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; + perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); DRM_DEBUG_ATOMIC( "crtc=%d clk_rate=%llu core_ib=%llu core_ab=%llu\n",@@ -236,17 +224,28 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,struct dpu_core_perf_params perf = {0 };int i, ret =0 ;u32 avg_bw; +u32 peak_bw;if (!kms->num_paths)return 0 ; -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); +if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { + avg_bw =0 ; + peak_bw =0 ; + }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { + avg_bw = kms->perf.fix_core_ab_vote; + peak_bw = kms->perf.fix_core_ib_vote; + }else { +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + + avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ + peak_bw = perf.max_per_pipe_ib; + } - avg_bw = perf.bw_ctl; -do_div (avg_bw, (kms->num_paths *1000 ));/*Bps_to_icc*/ + avg_bw /= kms->num_paths;for (i =0 ; i < kms->num_paths; i++) -icc_set_bw (kms->path[i], avg_bw, perf.max_per_pipe_ib); +icc_set_bw (kms->path[i], avg_bw, peak_bw);return ret; }
Signature · 2 lines
With best wishes Dmitry
PATCH v2 6/14 drm/msm/dpu: rework core_perf debugfs overrides
In reply to Dmitry BaryshkovCurrently debugfs provides separate 'modes' to override calculated MDP_CLK rate and interconnect bandwidth votes. Change that to allow overriding individual values (e.g. one can override just clock or just average bandwidth vote).
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 87 ++----------------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 10 --- 2 files changed, 9 insertions(+), 88 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +9 -78
@@ -17,20 +17,6 @@#include "dpu_crtc.h" #include "dpu_core_perf.h" -/** -* enum dpu_perf_mode - performance tuning mode -* @DPU_PERF_MODE_NORMAL: performance controlled by user mode client -* @DPU_PERF_MODE_MINIMUM: performance bounded by minimum setting -* @DPU_PERF_MODE_FIXED: performance bounded by fixed setting -* @DPU_PERF_MODE_MAX: maximum value, used for error checking -*/ -enum dpu_perf_mode { -DPU_PERF_MODE_NORMAL , -DPU_PERF_MODE_MINIMUM , -DPU_PERF_MODE_FIXED , -DPU_PERF_MODE_MAX -}; -/** * _dpu_core_perf_calc_bw() - to calculate BW per crtc * @kms: pointer to the dpu_kms
@@ -229,18 +215,16 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,if (!kms->num_paths)return 0 ; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { - avg_bw =0 ; - peak_bw =0 ; - }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + + avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ + peak_bw = perf.max_per_pipe_ib; + +if (kms->perf.fix_core_ab_vote) avg_bw = kms->perf.fix_core_ab_vote; - peak_bw = kms->perf.fix_core_ib_vote; - }else { -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); - avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ - peak_bw = perf.max_per_pipe_ib; - } +if (kms->perf.fix_core_ib_vote) + peak_bw = kms->perf.fix_core_ib_vote; avg_bw /= kms->num_paths;
@@ -294,12 +278,9 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms)struct drm_crtc *crtc;struct dpu_crtc_state *dpu_cstate; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) +if (kms->perf.fix_core_clk_rate)return kms->perf.fix_core_clk_rate; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) -return kms->perf.max_core_clk_rate; -drm_for_each_crtc (crtc, kms->dev) {if (crtc->enabled) { dpu_cstate =to_dpu_crtc_state (crtc->state);
@@ -416,54 +397,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,#ifdef CONFIG_DEBUG_FS -static ssize_t _dpu_core_perf_mode_write (struct file *file, -const char __user *user_buf,size_t count,loff_t *ppos) -{ -struct dpu_core_perf *perf = file->private_data; -u32 perf_mode =0 ; -int ret; - - ret =kstrtouint_from_user (user_buf, count,0 , &perf_mode); -if (ret) -return ret; - -if (perf_mode >=DPU_PERF_MODE_MAX ) -return -EINVAL ; - -if (perf_mode ==DPU_PERF_MODE_FIXED ) { -DRM_INFO ("fix performance mode\n" ); - }else if (perf_mode ==DPU_PERF_MODE_MINIMUM ) { -/* run the driver with max clk and BW vote */ -DRM_INFO ("minimum performance mode\n" ); - }else if (perf_mode ==DPU_PERF_MODE_NORMAL ) { -/* reset the perf tune params to 0 */ -DRM_INFO ("normal performance mode\n" ); - } - perf->perf_tune.mode = perf_mode; - -return count; -} - -static ssize_t _dpu_core_perf_mode_read (struct file *file, -char __user *buff,size_t count,loff_t *ppos) -{ -struct dpu_core_perf *perf = file->private_data; -int len; -char buf[128 ]; - - len =scnprintf (buf,sizeof (buf), -"mode %d\n" , - perf->perf_tune.mode); - -return simple_read_from_buffer (buff, count, ppos, buf, len); -} - -static const struct file_operations dpu_core_perf_mode_fops = { - .open = simple_open, - .read = _dpu_core_perf_mode_read, - .write = _dpu_core_perf_mode_write, -}; -int dpu_core_perf_debugfs_init (struct dpu_kms *dpu_kms,struct dentry *parent) {struct dpu_core_perf *perf = &dpu_kms->perf;
@@ -488,8 +421,6 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) (u32 *)&catalog->perf->min_llcc_ib);debugfs_create_u32 ("min_dram_ib" ,0600 , entry, (u32 *)&catalog->perf->min_dram_ib); -debugfs_create_file ("perf_mode" ,0600 , entry, - (u32 *)perf, &dpu_core_perf_mode_fops);debugfs_create_u64 ("fix_core_clk_rate" ,0600 , entry, &perf->fix_core_clk_rate); debugfs_create_u64("fix_core_ib_vote", 0600, entry,
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -10
@@ -26,14 +26,6 @@ struct dpu_core_perf_params {u64 core_clk_rate; }; -/** -* struct dpu_core_perf_tune - definition of performance tuning control -* @mode: performance mode -*/ -struct dpu_core_perf_tune { -u32 mode; -}; -/** * struct dpu_core_perf - definition of core performance context * @dev: Pointer to drm device
@@ -42,7 +34,6 @@ struct dpu_core_perf_tune {* @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate -* @perf_tune: debug control for performance tuning * @enable_bw_release: debug control for bandwidth release * @fix_core_clk_rate: fixed core clock request in Hz used in mode 2 * @fix_core_ib_vote: fixed core ib vote in bps used in mode 2
@@ -55,7 +46,6 @@ struct dpu_core_perf {struct clk *core_clk;u64 core_clk_rate;u64 max_core_clk_rate; -struct dpu_core_perf_tune perf_tune;u32 enable_bw_release;u64 fix_core_clk_rate;u64 fix_core_ib_vote;
Signature · 1 line
2.39.2
Re: [PATCH v2 06/14] drm/msm/dpu: rework core_perf debugfs overrides
Quoted 6 lines · Dmitry Baryshkov
Currently debugfs provides separate 'modes' to override calculated
MDP_CLKrate and interconnect bandwidth votes. Change that to allow overriding individual values (e.g. one can override just clock or just average bandwidth vote).Signed-off-by Dmitry Baryshkov <[email protected]>
Can you break this out into a separate series on its own?
I would like to spend more time on this and dont want to hold up the rest of the cleanup part of the series for this.
Quoted 170 lines
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 87 ++----------------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 10 --- 2 files changed, 9 insertions(+), 88 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +9
-78@@ -17,20 +17,6 @@#include "dpu_crtc.h" #include "dpu_core_perf.h" -/** -* enum dpu_perf_mode - performance tuning mode -* @DPU_PERF_MODE_NORMAL: performance controlled by user mode client -* @DPU_PERF_MODE_MINIMUM: performance bounded by minimum setting -* @DPU_PERF_MODE_FIXED: performance bounded by fixed setting -* @DPU_PERF_MODE_MAX: maximum value, used for error checking -*/ -enum dpu_perf_mode { -DPU_PERF_MODE_NORMAL , -DPU_PERF_MODE_MINIMUM , -DPU_PERF_MODE_FIXED , -DPU_PERF_MODE_MAX -}; -/** * _dpu_core_perf_calc_bw() - to calculate BW per crtc * @kms: pointer to the dpu_kms @@ -229,18 +215,16 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,if (!kms->num_paths)return 0 ; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) { - avg_bw =0 ; - peak_bw =0 ; - }else if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) { +dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); + + avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ + peak_bw = perf.max_per_pipe_ib; + +if (kms->perf.fix_core_ab_vote) avg_bw = kms->perf.fix_core_ab_vote; - peak_bw = kms->perf.fix_core_ib_vote; - }else { -dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); - avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ - peak_bw = perf.max_per_pipe_ib; - } +if (kms->perf.fix_core_ib_vote) + peak_bw = kms->perf.fix_core_ib_vote; avg_bw /= kms->num_paths;@@ -294,12 +278,9 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms)struct drm_crtc *crtc;struct dpu_crtc_state *dpu_cstate; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_FIXED ) +if (kms->perf.fix_core_clk_rate)return kms->perf.fix_core_clk_rate; -if (kms->perf.perf_tune.mode ==DPU_PERF_MODE_MINIMUM ) -return kms->perf.max_core_clk_rate; -drm_for_each_crtc (crtc, kms->dev) {if (crtc->enabled) { dpu_cstate =to_dpu_crtc_state (crtc->state);@@ -416,54 +397,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,#ifdef CONFIG_DEBUG_FS -static ssize_t _dpu_core_perf_mode_write (struct file *file, -const char __user *user_buf,size_t count,loff_t *ppos) -{ -struct dpu_core_perf *perf = file->private_data; -u32 perf_mode =0 ; -int ret; - - ret =kstrtouint_from_user (user_buf, count,0 , &perf_mode); -if (ret) -return ret; - -if (perf_mode >=DPU_PERF_MODE_MAX ) -return -EINVAL ; - -if (perf_mode ==DPU_PERF_MODE_FIXED ) { -DRM_INFO ("fix performance mode\n" ); - }else if (perf_mode ==DPU_PERF_MODE_MINIMUM ) { -/* run the driver with max clk and BW vote */ -DRM_INFO ("minimum performance mode\n" ); - }else if (perf_mode ==DPU_PERF_MODE_NORMAL ) { -/* reset the perf tune params to 0 */ -DRM_INFO ("normal performance mode\n" ); - } - perf->perf_tune.mode = perf_mode; - -return count; -} - -static ssize_t _dpu_core_perf_mode_read (struct file *file, -char __user *buff,size_t count,loff_t *ppos) -{ -struct dpu_core_perf *perf = file->private_data; -int len; -char buf[128 ]; - - len =scnprintf (buf,sizeof (buf), -"mode %d\n" , - perf->perf_tune.mode); - -return simple_read_from_buffer (buff, count, ppos, buf, len); -} - -static const struct file_operations dpu_core_perf_mode_fops = { - .open = simple_open, - .read = _dpu_core_perf_mode_read, - .write = _dpu_core_perf_mode_write, -}; -int dpu_core_perf_debugfs_init (struct dpu_kms *dpu_kms,struct dentry *parent) {struct dpu_core_perf *perf = &dpu_kms->perf;@@ -488,8 +421,6 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) (u32 *)&catalog->perf->min_llcc_ib);debugfs_create_u32 ("min_dram_ib" ,0600 , entry, (u32 *)&catalog->perf->min_dram_ib); -debugfs_create_file ("perf_mode" ,0600 , entry, - (u32 *)perf, &dpu_core_perf_mode_fops);debugfs_create_u64 ("fix_core_clk_rate" ,0600 , entry, &perf->fix_core_clk_rate); debugfs_create_u64("fix_core_ib_vote", 0600, entry,drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0
-10@@ -26,14 +26,6 @@ struct dpu_core_perf_params {u64 core_clk_rate; }; -/** -* struct dpu_core_perf_tune - definition of performance tuning control -* @mode: performance mode -*/ -struct dpu_core_perf_tune { -u32 mode; -}; -/** * struct dpu_core_perf - definition of core performance context * @dev: Pointer to drm device @@ -42,7 +34,6 @@ struct dpu_core_perf_tune {* @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate -* @perf_tune: debug control for performance tuning * @enable_bw_release: debug control for bandwidth release * @fix_core_clk_rate: fixed core clock request in Hz used in mode 2 * @fix_core_ib_vote: fixed core ib vote in bps used in mode 2 @@ -55,7 +46,6 @@ struct dpu_core_perf {struct clk *core_clk;u64 core_clk_rate;u64 max_core_clk_rate; -struct dpu_core_perf_tune perf_tune;u32 enable_bw_release;u64 fix_core_clk_rate;u64 fix_core_ib_vote;
PATCH v2 7/14 drm/msm/dpu: drop dpu_core_perf_params::max_per_pipe_ib
In reply to Dmitry BaryshkovThe max_per_pipe_ib is a constant across all CRTCs and is read from the catalog. Drop corresponding calculations and read the value directly at icc_set_bw() time.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 17 +++++------------ drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 2 -- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +5 -12
@@ -103,13 +103,12 @@ static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms, } perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); - perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state);DRM_DEBUG_ATOMIC ( -"crtc=%d clk_rate=%llu core_ib=%llu core_ab=%llu\n" , +"crtc=%d clk_rate=%llu core_ab=%llu\n" , crtc->base.id, perf->core_clk_rate, - perf->max_per_pipe_ib, perf->bw_ctl); + perf->bw_ctl); } int dpu_core_perf_crtc_check(struct drm_crtc *crtc,
@@ -192,9 +191,6 @@ static void dpu_core_perf_aggregate(struct drm_device *ddev, curr_client_type == dpu_crtc_get_client_type(tmp_crtc)) { dpu_cstate =to_dpu_crtc_state (tmp_crtc->state); - perf->max_per_pipe_ib =max (perf->max_per_pipe_ib, - dpu_cstate->new_perf.max_per_pipe_ib); - perf->bw_ctl += dpu_cstate->new_perf.bw_ctl; DRM_DEBUG_ATOMIC("crtc=%d bw=%llu\n",
@@ -218,7 +214,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ - peak_bw = perf.max_per_pipe_ib; + peak_bw = kms->catalog->perf->min_dram_ib;if (kms->perf.fix_core_ab_vote) avg_bw = kms->perf.fix_core_ab_vote;
@@ -333,15 +329,12 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,* 2. new bandwidth vote - "ab or ib vote" is lower * than current vote at end of commit or stop. */ -if ((params_changed && ((new->bw_ctl > old->bw_ctl) || - (new->max_per_pipe_ib > old->max_per_pipe_ib))) || - (!params_changed && ((new->bw_ctl < old->bw_ctl) || - (new->max_per_pipe_ib < old->max_per_pipe_ib)))) { +if ((params_changed && new->bw_ctl > old->bw_ctl) || + (!params_changed && new->bw_ctl < old->bw_ctl)) {DRM_DEBUG_ATOMIC ("crtc=%d p=%d new_bw=%llu,old_bw=%llu\n" , crtc->base.id, params_changed, new->bw_ctl, old->bw_ctl); old->bw_ctl = new->bw_ctl; - old->max_per_pipe_ib = new->max_per_pipe_ib; update_bus = true; }
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -2
@@ -16,12 +16,10 @@/** * struct dpu_core_perf_params - definition of performance parameters -* @max_per_pipe_ib: maximum instantaneous bandwidth request * @bw_ctl: arbitrated bandwidth request * @core_clk_rate: core clock rate request */ struct dpu_core_perf_params { -u64 max_per_pipe_ib;u64 bw_ctl;u64 core_clk_rate; };
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +0 -2
@@ -1400,8 +1400,6 @@ static int dpu_crtc_debugfs_state_show(struct seq_file *s, void *v)seq_printf (s,"core_clk_rate: %llu\n" , dpu_crtc->cur_perf.core_clk_rate);seq_printf (s,"bw_ctl: %llu\n" , dpu_crtc->cur_perf.bw_ctl); -seq_printf (s,"max_per_pipe_ib: %llu\n" , - dpu_crtc->cur_perf.max_per_pipe_ib);return 0 ; }
Signature · 1 line
2.39.2
PATCH v2 8/14 drm/msm/dpu: rework indentation in dpu_core_perf
In reply to Dmitry Baryshkovdpu_core_perf.c contains several multi-line conditions which are hard to comprehent because of the indentation. Rework the identation of these conditions to make it easier to understand them.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +4 -6
@@ -146,8 +146,8 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,drm_for_each_crtc (tmp_crtc, crtc->dev) {if (tmp_crtc->enabled && - (dpu_crtc_get_client_type (tmp_crtc) == - curr_client_type) && (tmp_crtc != crtc)) { +dpu_crtc_get_client_type (tmp_crtc) == curr_client_type && + tmp_crtc != crtc) {struct dpu_crtc_state *tmp_cstate =to_dpu_crtc_state (tmp_crtc->state);
@@ -338,10 +338,8 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, update_bus = true; } -if ((params_changed && - (new->core_clk_rate > old->core_clk_rate)) || - (!params_changed && - (new->core_clk_rate < old->core_clk_rate))) { +if ((params_changed && new->core_clk_rate > old->core_clk_rate) || + (!params_changed && new->core_clk_rate < old->core_clk_rate)) { old->core_clk_rate = new->core_clk_rate; update_clk = true; }
Signature · 1 line
2.39.2
PATCH v2 9/14 drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param
In reply to Dmitry BaryshkovThe stop_req is true only in the dpu_crtc_disable() case, when crtc->enable has already been set to false. This renders the stop_req argument useless. Remove it completely.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 12 ++++++------ drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 +++--- 3 files changed, 10 insertions(+), 11 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +6 -6
@@ -291,7 +291,7 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) }int dpu_core_perf_crtc_update (struct drm_crtc *crtc, -int params_changed,bool stop_req) +int params_changed) {struct dpu_core_perf_params *new, *old;bool update_bus = false, update_clk = false;
@@ -315,13 +315,13 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, dpu_crtc =to_dpu_crtc (crtc); dpu_cstate =to_dpu_crtc_state (crtc->state); -DRM_DEBUG_ATOMIC ("crtc:%d stop_req:%d core_clk:%llu\n" , - crtc->base.id, stop_req, kms->perf.core_clk_rate); +DRM_DEBUG_ATOMIC ("crtc:%d enabled:%d core_clk:%llu\n" , + crtc->base.id, crtc->enabled, kms->perf.core_clk_rate); old = &dpu_crtc->cur_perf; new = &dpu_cstate->new_perf; -if (crtc->enabled && !stop_req) { +if (crtc->enabled) {/* * cases for bus bandwidth update. * 1. new bandwidth vote - "ab or ib vote" is higher
@@ -351,7 +351,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, }trace_dpu_perf_crtc_update (crtc->base.id, new->bw_ctl, - new->core_clk_rate, stop_req, update_bus, update_clk); + new->core_clk_rate, !crtc->enabled, update_bus, update_clk);if (update_bus) { ret =_dpu_core_perf_crtc_update_bus (kms, crtc);
@@ -371,7 +371,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("clk:%llu\n" , clk_rate); -trace_dpu_core_perf_update_clk (kms->dev, stop_req, clk_rate); +trace_dpu_core_perf_update_clk (kms->dev, !crtc->enabled, clk_rate); clk_rate =min (clk_rate, kms->perf.max_core_clk_rate); ret =dev_pm_opp_set_rate (&kms->pdev->dev, clk_rate);
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +1 -2
@@ -63,11 +63,10 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,* dpu_core_perf_crtc_update - update performance of the given crtc * @crtc: Pointer to crtc * @params_changed: true if crtc parameters are modified -* @stop_req: true if this is a stop request * return: zero if success, or error code otherwise */ int dpu_core_perf_crtc_update (struct drm_crtc *crtc, -int params_changed,bool stop_req); +int params_changed);/** * dpu_core_perf_crtc_release_bw - release bandwidth of the given crtc
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +3 -3
@@ -718,7 +718,7 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event)void dpu_crtc_complete_commit (struct drm_crtc *crtc) {trace_dpu_crtc_complete_commit (DRMID (crtc)); -dpu_core_perf_crtc_update (crtc,0 , false); +dpu_core_perf_crtc_update (crtc,0 );_dpu_crtc_complete_flip (crtc); }
@@ -884,7 +884,7 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc,return ;/* update performance setting before crtc kickoff */ -dpu_core_perf_crtc_update (crtc,1 , false); +dpu_core_perf_crtc_update (crtc,1 );/* * Final plane updates: Give each plane a chance to complete all
@@ -1100,7 +1100,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc,atomic_set (&dpu_crtc->frame_pending,0 ); } -dpu_core_perf_crtc_update (crtc,0 , true); +dpu_core_perf_crtc_update (crtc,0 );drm_for_each_encoder_mask (encoder, crtc->dev, crtc->state->encoder_mask)dpu_encoder_register_frame_event_callback (encoder,NULL ,NULL );
Signature · 1 line
2.39.2
PATCH v2 10/14 drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code
In reply to Dmitry BaryshkovSimplify dpu_core_perf code by using only dpu_perf_cfg instead of using full-featured catalog data.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 58 +++++++------------ drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- 3 files changed, 27 insertions(+), 41 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +22 -36
@@ -19,11 +19,11 @@/** * _dpu_core_perf_calc_bw() - to calculate BW per crtc -* @kms: pointer to the dpu_kms +* @perf_cfg: performance configuration * @crtc: pointer to a crtc * Return: returns aggregated BW for all planes in crtc. */ -static u64 _dpu_core_perf_calc_bw (struct dpu_kms *kms, +static u64 _dpu_core_perf_calc_bw (const struct dpu_perf_cfg *perf_cfg,struct drm_crtc *crtc) {struct drm_plane *plane;
@@ -39,7 +39,7 @@ static u64 _dpu_core_perf_calc_bw(struct dpu_kms *kms, crtc_plane_bw += pstate->plane_fetch_bw; } - bw_factor = kms->catalog->perf->bw_inefficiency_factor; + bw_factor = perf_cfg->bw_inefficiency_factor;if (bw_factor) { crtc_plane_bw *= bw_factor;do_div (crtc_plane_bw,100 );
@@ -50,12 +50,12 @@ static u64 _dpu_core_perf_calc_bw(struct dpu_kms *kms,/** * _dpu_core_perf_calc_clk() - to calculate clock per crtc -* @kms: pointer to the dpu_kms +* @perf_cfg: performance configuration * @crtc: pointer to a crtc * @state: pointer to a crtc state * Return: returns max clk for all planes in crtc. */ -static u64 _dpu_core_perf_calc_clk (struct dpu_kms *kms, +static u64 _dpu_core_perf_calc_clk (const struct dpu_perf_cfg *perf_cfg,struct drm_crtc *crtc,struct drm_crtc_state *state) {struct drm_plane *plane;
@@ -76,7 +76,7 @@ static u64 _dpu_core_perf_calc_clk(struct dpu_kms *kms, crtc_clk =max (pstate->plane_clk, crtc_clk); } - clk_factor = kms->catalog->perf->clk_inefficiency_factor; + clk_factor = perf_cfg->clk_inefficiency_factor;if (clk_factor) { crtc_clk *= clk_factor;do_div (crtc_clk,100 );
@@ -92,18 +92,18 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc)return to_dpu_kms (priv->kms); } -static void _dpu_core_perf_calc_crtc (struct dpu_kms *kms, +static void _dpu_core_perf_calc_crtc (const struct dpu_perf_cfg *perf_cfg,struct drm_crtc *crtc,struct drm_crtc_state *state,struct dpu_core_perf_params *perf) { -if (!kms || !kms->catalog || !crtc || !state || !perf) { +if (!perf_cfg || !crtc || !state || !perf) {DPU_ERROR ("invalid parameters\n" );return ; } - perf->bw_ctl =_dpu_core_perf_calc_bw (kms, crtc); - perf->core_clk_rate =_dpu_core_perf_calc_clk (kms, crtc, state); + perf->bw_ctl =_dpu_core_perf_calc_bw (perf_cfg, crtc); + perf->core_clk_rate =_dpu_core_perf_calc_clk (perf_cfg, crtc, state); DRM_DEBUG_ATOMIC( "crtc=%d clk_rate=%llu core_ab=%llu\n",
@@ -120,6 +120,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc,struct dpu_crtc_state *dpu_cstate;struct drm_crtc *tmp_crtc;struct dpu_kms *kms; +const struct dpu_perf_cfg *perf_cfg;if (!crtc || !state) {DPU_ERROR ("invalid crtc\n" );
@@ -127,10 +128,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, } kms =_dpu_crtc_get_kms (crtc); -if (!kms->catalog) { -DPU_ERROR ("invalid parameters\n" ); -return 0 ; - } + perf_cfg = kms->perf.perf_cfg;/* we only need bandwidth check on real-time clients (interfaces) */ if (dpu_crtc_get_client_type (crtc) ==NRT_CLIENT )
@@ -139,7 +137,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, dpu_cstate =to_dpu_crtc_state (state);/* obtain new values */ -_dpu_core_perf_calc_crtc (kms, crtc, state, &dpu_cstate->new_perf); +_dpu_core_perf_calc_crtc (perf_cfg, crtc, state, &dpu_cstate->new_perf); bw_sum_of_intfs = dpu_cstate->new_perf.bw_ctl; curr_client_type =dpu_crtc_get_client_type (crtc);
@@ -162,7 +160,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, bw =DIV_ROUND_UP_ULL (bw_sum_of_intfs,1000 );DRM_DEBUG_ATOMIC ("calculated bandwidth=%uk\n" , bw); - threshold = kms->catalog->perf->max_bw_high; + threshold = perf_cfg->max_bw_high;DRM_DEBUG_ATOMIC ("final threshold bw limit = %d\n" , threshold);
@@ -214,7 +212,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,dpu_core_perf_aggregate (crtc->dev,dpu_crtc_get_client_type (crtc), &perf); avg_bw =div_u64 (perf.bw_ctl,1000 );/*Bps_to_icc*/ - peak_bw = kms->catalog->perf->min_dram_ib; + peak_bw = kms->perf.perf_cfg->min_dram_ib;if (kms->perf.fix_core_ab_vote) avg_bw = kms->perf.fix_core_ab_vote;
@@ -248,12 +246,6 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc)return ; } - kms =_dpu_crtc_get_kms (crtc); -if (!kms->catalog) { -DPU_ERROR ("invalid kms\n" ); -return ; - } - dpu_crtc =to_dpu_crtc (crtc);if (atomic_dec_return (&kms->bandwidth_ref) >0 )
@@ -307,10 +299,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, } kms =_dpu_crtc_get_kms (crtc); -if (!kms->catalog) { -DPU_ERROR ("invalid kms\n" ); -return -EINVAL ; - } dpu_crtc =to_dpu_crtc (crtc); dpu_cstate =to_dpu_crtc_state (crtc->state);
@@ -391,7 +379,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,int dpu_core_perf_debugfs_init (struct dpu_kms *dpu_kms,struct dentry *parent) {struct dpu_core_perf *perf = &dpu_kms->perf; -const struct dpu_mdss_cfg *catalog = perf->catalog;struct dentry *entry; entry =debugfs_create_dir ("core_perf" , parent);
@@ -403,15 +390,15 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent)debugfs_create_u32 ("enable_bw_release" ,0600 , entry, (u32 *)&perf->enable_bw_release);debugfs_create_u32 ("threshold_low" ,0600 , entry, - (u32 *)&catalog->perf->max_bw_low); + (u32 *)&perf->perf_cfg->max_bw_low);debugfs_create_u32 ("threshold_high" ,0600 , entry, - (u32 *)&catalog->perf->max_bw_high); + (u32 *)&perf->perf_cfg->max_bw_high);debugfs_create_u32 ("min_core_ib" ,0600 , entry, - (u32 *)&catalog->perf->min_core_ib); + (u32 *)&perf->perf_cfg->min_core_ib);debugfs_create_u32 ("min_llcc_ib" ,0600 , entry, - (u32 *)&catalog->perf->min_llcc_ib); + (u32 *)&perf->perf_cfg->min_llcc_ib);debugfs_create_u32 ("min_dram_ib" ,0600 , entry, - (u32 *)&catalog->perf->min_dram_ib); + (u32 *)&perf->perf_cfg->min_dram_ib);debugfs_create_u64 ("fix_core_clk_rate" ,0600 , entry, &perf->fix_core_clk_rate); debugfs_create_u64("fix_core_ib_vote", 0600, entry,
@@ -432,17 +419,16 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) perf->max_core_clk_rate =0 ; perf->core_clk =NULL ; - perf->catalog =NULL ; perf->dev =NULL ; }int dpu_core_perf_init (struct dpu_core_perf *perf,struct drm_device *dev, -const struct dpu_mdss_cfg *catalog, +const struct dpu_perf_cfg *perf_cfg,struct clk *core_clk) { perf->dev = dev; - perf->catalog = catalog; + perf->perf_cfg = perf_cfg; perf->core_clk = core_clk; perf->max_core_clk_rate =clk_get_rate (core_clk);
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +4 -4
@@ -28,7 +28,7 @@ struct dpu_core_perf_params {* struct dpu_core_perf - definition of core performance context * @dev: Pointer to drm device * @debugfs_root: top level debug folder -* @catalog: Pointer to catalog configuration +* @perf_cfg: Platform-specific performance configuration * @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate
@@ -40,7 +40,7 @@ struct dpu_core_perf_params {struct dpu_core_perf {struct drm_device *dev;struct dentry *debugfs_root; -const struct dpu_mdss_cfg *catalog; +const struct dpu_perf_cfg *perf_cfg;struct clk *core_clk;u64 core_clk_rate;u64 max_core_clk_rate;
@@ -84,12 +84,12 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf);* dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context * @dev: Pointer to drm device -* @catalog: Pointer to catalog +* @perf_cfg: Pointer to platform performance configuration * @core_clk: pointer to core clock */ int dpu_core_perf_init (struct dpu_core_perf *perf,struct drm_device *dev, -const struct dpu_mdss_cfg *catalog, +const struct dpu_perf_cfg *perf_cfg,struct clk *core_clk);struct dpu_kms ;
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 -1
@@ -1115,7 +1115,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc =dpu_core_perf_init (&dpu_kms->perf, dev, dpu_kms->catalog, + rc =dpu_core_perf_init (&dpu_kms->perf, dev, dpu_kms->catalog->perf,msm_clk_bulk_get_clock (dpu_kms->clocks, dpu_kms->num_clocks,"core" ));if (rc) {DPU_ERROR ("failed to init perf %d\n" , rc);
Signature · 1 line
2.39.2
kernel test robot
build botRe: [PATCH v2 10/14] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code
kernel test robot noticed the following build warnings:
Hi Dmitry,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v6.4 next-20230705] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Baryshkov/drm-msm-dpu-drop-enum-dpu_core_perf_data_bus_id/20230704-230618 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20230704150354.159882-11-dmitry.baryshkov%40linaro.org patch subject: [PATCH v2 10/14] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code config: arm-defconfig (https://download.01.org/0day-ci/archive/20230706/[email protected]/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce: (https://download.01.org/0day-ci/archive/20230706/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:251:25: warning: variable 'kms' is uninitialized when used here [-Wuninitialized]
if (atomic_dec_return(&kms->bandwidth_ref) > 0)
^~~
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:242:21: note: initialize the variable 'kms' to silence this warning
struct dpu_kms *kms;
^
= NULL1 warning generated.
vim +/kms +251 drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 230
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 231 /**
2785fd47959003 Lee Jones 2020-11-23 232 * dpu_core_perf_crtc_release_bw() - request zero bandwidth
2785fd47959003 Lee Jones 2020-11-23 233 * @crtc: pointer to a crtc
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 234 *
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 235 * Function checks a state variable for the crtc, if all pending commit
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 236 * requests are done, meaning no more bandwidth is needed, release
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 237 * bandwidth request.
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 238 */
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 239 void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc)
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 240 {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 241 struct dpu_crtc *dpu_crtc;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 242 struct dpu_kms *kms;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 243
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 244 if (!crtc) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 245 DPU_ERROR("invalid crtc\n");
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 246 return;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 247 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 248
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 249 dpu_crtc = to_dpu_crtc(crtc);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 250
241b507c166fef Rob Clark 2019-08-20 @251 if (atomic_dec_return(&kms->bandwidth_ref) > 0)
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 252 return;
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 253
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 254 /* Release the bandwidth */
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 255 if (kms->perf.enable_bw_release) {
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 256 trace_dpu_cmd_release_bw(crtc->base.id);
5b702d787b47e1 Stephen Boyd 2021-04-30 257 DRM_DEBUG_ATOMIC("Release BW crtc=%d\n", crtc->base.id);
cb88482e2570f6 Jayant Shekhar 2019-06-18 258 dpu_crtc->cur_perf.bw_ctl = 0;
cb88482e2570f6 Jayant Shekhar 2019-06-18 259 _dpu_core_perf_crtc_update_bus(kms, crtc);
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 260 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 261 }
25fdd5933e4c0f Jeykumar Sankaran 2018-06-27 262 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v2 11/14 drm/msm/dpu: remove unused fields from struct dpu_core_perf
In reply to Dmitry BaryshkovRemove dpu_core_perf::dev and dpu_core_perf::debugfs_root fields, they are not used by the code.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 3 --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +0 -3
@@ -419,15 +419,12 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) perf->max_core_clk_rate =0 ; perf->core_clk =NULL ; - perf->dev =NULL ; }int dpu_core_perf_init (struct dpu_core_perf *perf, -struct drm_device *dev,const struct dpu_perf_cfg *perf_cfg,struct clk *core_clk) { - perf->dev = dev; perf->perf_cfg = perf_cfg; perf->core_clk = core_clk;
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -6
@@ -26,8 +26,6 @@ struct dpu_core_perf_params {/** * struct dpu_core_perf - definition of core performance context -* @dev: Pointer to drm device -* @debugfs_root: top level debug folder * @perf_cfg: Platform-specific performance configuration * @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate
@@ -38,8 +36,6 @@ struct dpu_core_perf_params {* @fix_core_ab_vote: fixed core ab vote in bps used in mode 2 */ struct dpu_core_perf { -struct drm_device *dev; -struct dentry *debugfs_root;const struct dpu_perf_cfg *perf_cfg;struct clk *core_clk;u64 core_clk_rate;
@@ -83,12 +79,10 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf);/** * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context -* @dev: Pointer to drm device * @perf_cfg: Pointer to platform performance configuration * @core_clk: pointer to core clock */ int dpu_core_perf_init (struct dpu_core_perf *perf, -struct drm_device *dev,const struct dpu_perf_cfg *perf_cfg,struct clk *core_clk);
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 -1
@@ -1115,7 +1115,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc =dpu_core_perf_init (&dpu_kms->perf, dev, dpu_kms->catalog->perf, + rc =dpu_core_perf_init (&dpu_kms->perf, dpu_kms->catalog->perf,msm_clk_bulk_get_clock (dpu_kms->clocks, dpu_kms->num_clocks,"core" ));if (rc) {DPU_ERROR ("failed to init perf %d\n" , rc);
Signature · 1 line
2.39.2
PATCH v2 12/14 drm/msm/dpu: core_perf: remove extra clk_round_rate() call
In reply to Dmitry BaryshkovThe dev_pm_opp_set_rate() already contains a call for clk_round_rate for the passed value. Stop calling it manually from _dpu_core_perf_get_core_clk_rate(). It is slightly incorrect to call it this way, as we should round the final calculated clock rate rather than rounding all the intermediate values.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +0 -2
@@ -274,8 +274,6 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) dpu_cstate =to_dpu_crtc_state (crtc->state); clk_rate =max (dpu_cstate->new_perf.core_clk_rate, clk_rate); - clk_rate =clk_round_rate (kms->perf.core_clk, - clk_rate); } }
Signature · 1 line
2.39.2
PATCH v2 13/14 drm/msm/dpu: move max clock decision to dpu_kms.
In reply to Dmitry Baryshkovdpu_core_perf should not make decisions on the maximum possible core clock rate. Pass the value from dpu_kms_hw_init().
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 11 ++--------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 ++------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 13 +++++++++++-- 3 files changed, 15 insertions(+), 17 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +2 -9
@@ -416,21 +416,14 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) } perf->max_core_clk_rate =0 ; - perf->core_clk =NULL ; }int dpu_core_perf_init (struct dpu_core_perf *perf,const struct dpu_perf_cfg *perf_cfg, -struct clk *core_clk) +unsigned long max_core_clk_rate) { perf->perf_cfg = perf_cfg; - perf->core_clk = core_clk; - - perf->max_core_clk_rate =clk_get_rate (core_clk); -if (!perf->max_core_clk_rate) { -DPU_DEBUG ("optional max core clk rate, use default\n" ); - perf->max_core_clk_rate =DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE ; - } + perf->max_core_clk_rate = max_core_clk_rate;return 0 ; }
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +2 -6
@@ -12,8 +12,6 @@#include "dpu_hw_catalog.h" -#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 -/** * struct dpu_core_perf_params - definition of performance parameters * @bw_ctl: arbitrated bandwidth request
@@ -27,7 +25,6 @@ struct dpu_core_perf_params {/** * struct dpu_core_perf - definition of core performance context * @perf_cfg: Platform-specific performance configuration -* @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate * @enable_bw_release: debug control for bandwidth release
@@ -37,7 +34,6 @@ struct dpu_core_perf_params {*/ struct dpu_core_perf {const struct dpu_perf_cfg *perf_cfg; -struct clk *core_clk;u64 core_clk_rate;u64 max_core_clk_rate;u32 enable_bw_release;
@@ -80,11 +76,11 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf);* dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context * @perf_cfg: Pointer to platform performance configuration -* @core_clk: pointer to core clock +* @max_core_clk_rate: Maximum core clock rate */ int dpu_core_perf_init (struct dpu_core_perf *perf,const struct dpu_perf_cfg *perf_cfg, -struct clk *core_clk); +unsigned long max_core_clk_rate);struct dpu_kms ;
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +11 -2
@@ -1011,11 +1011,14 @@ unsigned long dpu_kms_get_clk_rate(struct dpu_kms *dpu_kms, char *clock_name)return clk_get_rate (clk); } +#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 +static int dpu_kms_hw_init (struct msm_kms *kms) {struct dpu_kms *dpu_kms;struct drm_device *dev;int i, rc = -EINVAL ; +unsigned long max_core_clk_rate;u32 core_rev;if (!kms) {
@@ -1115,8 +1118,14 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc =dpu_core_perf_init (&dpu_kms->perf, dpu_kms->catalog->perf, -msm_clk_bulk_get_clock (dpu_kms->clocks, dpu_kms->num_clocks,"core" )); +/* TODO: use the same max_freq as in dpu_kms_hw_init */ + max_core_clk_rate =dpu_kms_get_clk_rate (dpu_kms,"core" ); +if (!max_core_clk_rate) { +DPU_DEBUG ("max core clk rate not determined, using default\n" ); + max_core_clk_rate =DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE ; + } + + rc =dpu_core_perf_init (&dpu_kms->perf, dpu_kms->catalog->perf, max_core_clk_rate);if (rc) {DPU_ERROR ("failed to init perf %d\n" , rc); goto perf_err;
Signature · 1 line
2.39.2
PATCH v2 14/14 drm/msm/dpu: drop dpu_core_perf_destroy()
In reply to Dmitry BaryshkovThis function does nothing, just clears several data pointers. Drop it now.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 - 3 files changed, 17 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +0 -10
@@ -408,16 +408,6 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) }#endif -void dpu_core_perf_destroy (struct dpu_core_perf *perf) -{ -if (!perf) { -DPU_ERROR ("invalid parameters\n" ); -return ; - } - - perf->max_core_clk_rate =0 ; -} -int dpu_core_perf_init (struct dpu_core_perf *perf,const struct dpu_perf_cfg *perf_cfg,unsigned long max_core_clk_rate)
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0 -6
@@ -66,12 +66,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,*/ void dpu_core_perf_crtc_release_bw (struct drm_crtc *crtc); -/** -* dpu_core_perf_destroy - destroy the given core performance context -* @perf: Pointer to core performance context -*/ -void dpu_core_perf_destroy (struct dpu_core_perf *perf); -/** * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +0 -1
@@ -1171,7 +1171,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms)return 0 ; drm_obj_init_err: -dpu_core_perf_destroy (&dpu_kms->perf); hw_intr_init_err: perf_err: power_error:
Signature · 1 line
2.39.2
Re: [PATCH v2 14/14] drm/msm/dpu: drop dpu_core_perf_destroy()
Quoted 3 lines · Dmitry Baryshkov
This function does nothing, just clears several data pointers. Drop it now.
Now, it doesnt even do that. Just resets the clk_rate to 0.
Quoted 58 lines
Acked-by Konrad Dybcio <[email protected]>Signed-off-by Dmitry Baryshkov <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 - 3 files changed, 17 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +0
-10@@ -408,16 +408,6 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) }#endif -void dpu_core_perf_destroy (struct dpu_core_perf *perf) -{ -if (!perf) { -DPU_ERROR ("invalid parameters\n" ); -return ; - } - - perf->max_core_clk_rate =0 ; -} -int dpu_core_perf_init (struct dpu_core_perf *perf,const struct dpu_perf_cfg *perf_cfg,unsigned long max_core_clk_rate)drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +0
-6@@ -66,12 +66,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,*/ void dpu_core_perf_crtc_release_bw (struct drm_crtc *crtc); -/** -* dpu_core_perf_destroy - destroy the given core performance context -* @perf: Pointer to core performance context -*/ -void dpu_core_perf_destroy (struct dpu_core_perf *perf); -/** * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +0
-1@@ -1171,7 +1171,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms)return 0 ; drm_obj_init_err: -dpu_core_perf_destroy (&dpu_kms->perf); hw_intr_init_err: perf_err: power_error: