summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2017-04-18 16:51:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:06:31 -0400
commit974db151d48b6793fc2b708d1c3f9ceee735fc5a (patch)
tree115ac761ce74e8de3e3ee3b9fb8461cae6e29bdf
parent50f27269b8dd81d73c787dd18ba19a08bec128d3 (diff)
drm/amd/display: remove unnecessary allocation for regamma_params inside opp
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_opp.c10
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c6
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c4
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/opp.h2
4 files changed, 5 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
index 121ccbb1ad2d..f716a9e8784e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
@@ -987,10 +987,6 @@ bool dce110_opp_construct(struct dce110_opp *opp110,
opp110->base.inst = inst;
- opp110->base.regamma_params = dm_alloc(sizeof(struct pwl_params));
- if (opp110->base.regamma_params == NULL)
- return false;
-
opp110->regs = regs;
opp110->opp_shift = opp_shift;
opp110->opp_mask = opp_mask;
@@ -1000,12 +996,8 @@ bool dce110_opp_construct(struct dce110_opp *opp110,
void dce110_opp_destroy(struct output_pixel_processor **opp)
{
- if (*opp) {
- if ((*opp)->regamma_params)
- dm_free((*opp)->regamma_params);
- (*opp)->regamma_params = NULL;
+ if (*opp)
dm_free(FROM_DCE11_OPP(*opp));
- }
*opp = NULL;
}
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 2fbf6ddcf3be..6b249f5bf1da 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -637,7 +637,7 @@ static bool dce110_set_output_transfer_func(
struct output_pixel_processor *opp = pipe_ctx->opp;
opp->funcs->opp_power_on_regamma_lut(opp, true);
- opp->regamma_params->hw_points_num = GAMMA_HW_POINTS_NUM;
+ opp->regamma_params.hw_points_num = GAMMA_HW_POINTS_NUM;
if (stream->public.out_transfer_func &&
stream->public.out_transfer_func->type ==
@@ -646,8 +646,8 @@ static bool dce110_set_output_transfer_func(
TRANSFER_FUNCTION_SRGB) {
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_SRGB);
} else if (dce110_translate_regamma_to_hw_format(
- stream->public.out_transfer_func, opp->regamma_params)) {
- opp->funcs->opp_program_regamma_pwl(opp, opp->regamma_params);
+ stream->public.out_transfer_func, &opp->regamma_params)) {
+ opp->funcs->opp_program_regamma_pwl(opp, &opp->regamma_params);
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_USER);
} else {
opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_BYPASS);
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
index 95b3d2eb8428..6f8b414cabbc 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
@@ -56,10 +56,6 @@ bool dce110_opp_v_construct(struct dce110_opp *opp110,
opp110->base.ctx = ctx;
- opp110->base.regamma_params = dm_alloc(sizeof(struct pwl_params));
- if (opp110->base.regamma_params == NULL)
- return false;
-
return true;
}
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
index 521bd21eb5df..92c99c3b9002 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
@@ -203,7 +203,7 @@ enum opp_regamma {
struct output_pixel_processor {
struct dc_context *ctx;
uint32_t inst;
- struct pwl_params *regamma_params;
+ struct pwl_params regamma_params;
const struct opp_funcs *funcs;
};