All of lore.kernel.org
 help / color / mirror / Atom feed
* FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue
       [not found] <20230519111158.1354372-1-likun.gao@amd.com>
@ 2023-05-19 11:16 ` Gao, Likun
  2023-05-22  2:02   ` Xu, Feifei
       [not found] ` <20230519111158.1354372-2-likun.gao@amd.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Gao, Likun @ 2023-05-19 11:16 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Zhang, Hawking

[AMD Official Use Only - General]

From: Likun Gao <Likun.Gao@amd.com>

Fix NULL pointer issue for vga_set_state function as not all the ASIC need this operation.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ce196badf42d..5af954abd5ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1260,7 +1260,8 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
 /*
  * ASICs macro.
  */
-#define amdgpu_asic_set_vga_state(adev, state) (adev)->asic_funcs->set_vga_state((adev), (state))
+#define amdgpu_asic_set_vga_state(adev, state) \
+    ((adev)->asic_funcs->set_vga_state ?
+(adev)->asic_funcs->set_vga_state((adev), (state)) : 0)
 #define amdgpu_asic_reset(adev) (adev)->asic_funcs->reset((adev))  #define amdgpu_asic_reset_method(adev) (adev)->asic_funcs->reset_method((adev))
 #define amdgpu_asic_get_xclk(adev) (adev)->asic_funcs->get_xclk((adev))
--
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/amdgpu: retire set_vga_state for some ASIC
       [not found] ` <20230519111158.1354372-2-likun.gao@amd.com>
@ 2023-05-19 11:17   ` Gao, Likun
  2023-05-19 11:41     ` Zhang, Hawking
  0 siblings, 1 reply; 4+ messages in thread
From: Gao, Likun @ 2023-05-19 11:17 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Zhang, Hawking

[AMD Official Use Only - General]

From: Likun Gao <Likun.Gao@amd.com>

set_vga_state operation only allowed on SI generation ASIC, retire the realted function on those ASIC which did not do anything.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c    | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc15.c | 8 --------  drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------
 drivers/gpu/drm/amd/amdgpu/vi.c    | 6 ------
 4 files changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index a5f76c9538c4..51523b27a186 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -341,11 +341,6 @@ void nv_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15(GC, 0, mmGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void nv_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool nv_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -654,7 +649,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
        .read_register = &nv_read_register,
        .reset = &nv_asic_reset,
        .reset_method = &nv_asic_reset_method,
-       .set_vga_state = &nv_vga_set_state,
        .get_xclk = &nv_get_xclk,
        .set_uvd_clocks = &nv_set_uvd_clocks,
        .set_vce_clocks = &nv_set_vce_clocks,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 122ba1a505c3..135440b5afe9 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -346,11 +346,6 @@ void soc15_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15_RLC_SHADOW(GC, xcc_id, mmGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void soc15_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool soc15_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -849,7 +844,6 @@ static const struct amdgpu_asic_funcs soc15_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, @@ -871,7 +865,6 @@ static const struct amdgpu_asic_funcs vega20_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, @@ -893,7 +886,6 @@ static const struct amdgpu_asic_funcs aqua_vanjaram_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 6bff936a6e55..e5e5d68a4d70 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -248,11 +248,6 @@ void soc21_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15(GC, 0, regGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void soc21_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool soc21_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -559,7 +554,6 @@ static const struct amdgpu_asic_funcs soc21_asic_funcs =
        .read_register = &soc21_read_register,
        .reset = &soc21_asic_reset,
        .reset_method = &soc21_asic_reset_method,
-       .set_vga_state = &soc21_vga_set_state,
        .get_xclk = &soc21_get_xclk,
        .set_uvd_clocks = &soc21_set_uvd_clocks,
        .set_vce_clocks = &soc21_set_vce_clocks, diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 8e70581960fb..770f2d7a371f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -580,11 +580,6 @@ void vi_srbm_select(struct amdgpu_device *adev,
        WREG32(mmSRBM_GFX_CNTL, srbm_gfx_cntl);  }

-static void vi_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool vi_read_disabled_bios(struct amdgpu_device *adev)  {
        u32 bus_cntl;
@@ -1435,7 +1430,6 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =
        .read_register = &vi_read_register,
        .reset = &vi_asic_reset,
        .reset_method = &vi_asic_reset_method,
-       .set_vga_state = &vi_vga_set_state,
        .get_xclk = &vi_get_xclk,
        .set_uvd_clocks = &vi_set_uvd_clocks,
        .set_vce_clocks = &vi_set_vce_clocks,
--
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/2] drm/amdgpu: retire set_vga_state for some ASIC
  2023-05-19 11:17   ` [PATCH 2/2] drm/amdgpu: retire set_vga_state for some ASIC Gao, Likun
@ 2023-05-19 11:41     ` Zhang, Hawking
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Hawking @ 2023-05-19 11:41 UTC (permalink / raw)
  To: Gao, Likun, amd-gfx list

[AMD Official Use Only - General]

Series is

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: Gao, Likun <Likun.Gao@amd.com> 
Sent: Friday, May 19, 2023 19:17
To: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH 2/2] drm/amdgpu: retire set_vga_state for some ASIC

[AMD Official Use Only - General]

From: Likun Gao <Likun.Gao@amd.com>

set_vga_state operation only allowed on SI generation ASIC, retire the realted function on those ASIC which did not do anything.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c    | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc15.c | 8 --------  drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------
 drivers/gpu/drm/amd/amdgpu/vi.c    | 6 ------
 4 files changed, 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index a5f76c9538c4..51523b27a186 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -341,11 +341,6 @@ void nv_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15(GC, 0, mmGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void nv_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool nv_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -654,7 +649,6 @@ static const struct amdgpu_asic_funcs nv_asic_funcs =
        .read_register = &nv_read_register,
        .reset = &nv_asic_reset,
        .reset_method = &nv_asic_reset_method,
-       .set_vga_state = &nv_vga_set_state,
        .get_xclk = &nv_get_xclk,
        .set_uvd_clocks = &nv_set_uvd_clocks,
        .set_vce_clocks = &nv_set_vce_clocks, diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 122ba1a505c3..135440b5afe9 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -346,11 +346,6 @@ void soc15_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15_RLC_SHADOW(GC, xcc_id, mmGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void soc15_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool soc15_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -849,7 +844,6 @@ static const struct amdgpu_asic_funcs soc15_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, @@ -871,7 +865,6 @@ static const struct amdgpu_asic_funcs vega20_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, @@ -893,7 +886,6 @@ static const struct amdgpu_asic_funcs aqua_vanjaram_asic_funcs =
        .read_register = &soc15_read_register,
        .reset = &soc15_asic_reset,
        .reset_method = &soc15_asic_reset_method,
-       .set_vga_state = &soc15_vga_set_state,
        .get_xclk = &soc15_get_xclk,
        .set_uvd_clocks = &soc15_set_uvd_clocks,
        .set_vce_clocks = &soc15_set_vce_clocks, diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 6bff936a6e55..e5e5d68a4d70 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -248,11 +248,6 @@ void soc21_grbm_select(struct amdgpu_device *adev,
        WREG32_SOC15(GC, 0, regGRBM_GFX_CNTL, grbm_gfx_cntl);  }

-static void soc21_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool soc21_read_disabled_bios(struct amdgpu_device *adev)  {
        /* todo */
@@ -559,7 +554,6 @@ static const struct amdgpu_asic_funcs soc21_asic_funcs =
        .read_register = &soc21_read_register,
        .reset = &soc21_asic_reset,
        .reset_method = &soc21_asic_reset_method,
-       .set_vga_state = &soc21_vga_set_state,
        .get_xclk = &soc21_get_xclk,
        .set_uvd_clocks = &soc21_set_uvd_clocks,
        .set_vce_clocks = &soc21_set_vce_clocks, diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 8e70581960fb..770f2d7a371f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -580,11 +580,6 @@ void vi_srbm_select(struct amdgpu_device *adev,
        WREG32(mmSRBM_GFX_CNTL, srbm_gfx_cntl);  }

-static void vi_vga_set_state(struct amdgpu_device *adev, bool state) -{
-       /* todo */
-}
-
 static bool vi_read_disabled_bios(struct amdgpu_device *adev)  {
        u32 bus_cntl;
@@ -1435,7 +1430,6 @@ static const struct amdgpu_asic_funcs vi_asic_funcs =
        .read_register = &vi_read_register,
        .reset = &vi_asic_reset,
        .reset_method = &vi_asic_reset_method,
-       .set_vga_state = &vi_vga_set_state,
        .get_xclk = &vi_get_xclk,
        .set_uvd_clocks = &vi_set_uvd_clocks,
        .set_vce_clocks = &vi_set_vce_clocks,
--
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue
  2023-05-19 11:16 ` FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue Gao, Likun
@ 2023-05-22  2:02   ` Xu, Feifei
  0 siblings, 0 replies; 4+ messages in thread
From: Xu, Feifei @ 2023-05-22  2:02 UTC (permalink / raw)
  To: Gao, Likun, amd-gfx list; +Cc: Zhang, Hawking

[AMD Official Use Only - General]

Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>



-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Gao, Likun
Sent: Friday, May 19, 2023 7:17 PM
To: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue

[AMD Official Use Only - General]

[AMD Official Use Only - General]

From: Likun Gao <Likun.Gao@amd.com>

Fix NULL pointer issue for vga_set_state function as not all the ASIC need this operation.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ce196badf42d..5af954abd5ba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1260,7 +1260,8 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
 /*
  * ASICs macro.
  */
-#define amdgpu_asic_set_vga_state(adev, state) (adev)->asic_funcs->set_vga_state((adev), (state))
+#define amdgpu_asic_set_vga_state(adev, state) \
+    ((adev)->asic_funcs->set_vga_state ?
+(adev)->asic_funcs->set_vga_state((adev), (state)) : 0)
 #define amdgpu_asic_reset(adev) (adev)->asic_funcs->reset((adev))  #define amdgpu_asic_reset_method(adev) (adev)->asic_funcs->reset_method((adev))
 #define amdgpu_asic_get_xclk(adev) (adev)->asic_funcs->get_xclk((adev))
--
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-22  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230519111158.1354372-1-likun.gao@amd.com>
2023-05-19 11:16 ` FW: [PATCH 1/2] drm/amdgpu: fix vga_set_state NULL pointer issue Gao, Likun
2023-05-22  2:02   ` Xu, Feifei
     [not found] ` <20230519111158.1354372-2-likun.gao@amd.com>
2023-05-19 11:17   ` [PATCH 2/2] drm/amdgpu: retire set_vga_state for some ASIC Gao, Likun
2023-05-19 11:41     ` Zhang, Hawking

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.