From: Tony Cheng <[email protected]>

Add an inst member to struct abm and set it to 0 in dce_abm_construct()
and dmub_abm_construct(), since ABM is a singleton.

No functional change; the field has no readers yet.

Reviewed-by: Jun Lei <[email protected]>
Reviewed-by: Alex Hung <[email protected]>
Signed-off-by: Tony Cheng <[email protected]>
Signed-off-by: George Zhang <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c  | 2 ++
 drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 1 +
 drivers/gpu/drm/amd/display/dc/inc/hw/abm.h   | 1 +
 3 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c 
b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
index 469b4b8f88a3..bd9e0173ff9d 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
@@ -220,6 +220,7 @@ static bool dce_abm_set_level(struct abm *abm, uint32_t 
level)
 
 static bool dce_abm_immediate_disable(struct abm *abm, uint32_t panel_inst)
 {
+
        if (abm->dmcu_is_running == false)
                return true;
 
@@ -272,6 +273,7 @@ static void dce_abm_construct(
        base->ctx = ctx;
        base->funcs = &dce_funcs;
        base->dmcu_is_running = false;
+       base->inst = 0;
 
        abm_dce->regs = regs;
        abm_dce->abm_shift = abm_shift;
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c 
b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
index 2df6e82b794f..8cca8599b917 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c
@@ -280,6 +280,7 @@ static void dmub_abm_construct(
        base->ctx = ctx;
        base->funcs = &abm_funcs;
        base->dmcu_is_running = false;
+       base->inst = 0;
 
        abm_dce->regs = regs;
        abm_dce->abm_shift = abm_shift;
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h 
b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
index 6ae7cf109565..e3fa987304da 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/abm.h
@@ -33,6 +33,7 @@ struct abm {
        struct dc_context *ctx;
        const struct abm_funcs *funcs;
        bool dmcu_is_running;
+       unsigned int inst;
 };
 
 struct abm_funcs {
-- 
2.55.0

Reply via email to