Skip to contentSkip to conversation

drm/amdgpu/display: properly guard dc_dsc_stream_bandwidth_in_kbps

PATCH In review Alex Deucher 3 participants 3 messages Mar 19, 2021

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/display: properly guard dc_dsc_stream_bandwidth_in_kbps

Move the function protoype to the right header and guard the call with CONFIG_DRM_AMD_DC_DCN as DSC is only available with DCN.

Fixes a03f6c0e26b2 ("drm/amd/display: Add changes for dsc bpp in 16ths and unify bw calculations")
Cc Dillon Varone <[email protected]>
Cc Stephen Rothwell <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 drivers/gpu/drm/amd/display/dc/dc_dsc.h       | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index 10e34e411e06..f9a33dc52c45 100644
@@ -3498,17 +3498,17 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable)
 	}
 }
 
-uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
-
 uint32_t dc_bandwidth_in_kbps_from_timing(
 	const struct dc_crtc_timing *timing)
 {
 	uint32_t bits_per_channel = 0;
 	uint32_t kbps;
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
 	if (timing->flags.DSC) {
 		return dc_dsc_stream_bandwidth_in_kbps(timing->pix_clk_100hz, timing->dsc_cfg.bits_per_pixel);
 	}
+#endif
 
 	switch (timing->display_color_depth) {
 	case COLOR_DEPTH_666:
drivers/gpu/drm/amd/display/dc/dc_dsc.h +2 -0
index 0c5d98524536..c51d2d961b7a 100644
@@ -88,4 +88,6 @@ void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit);
 
 void dc_dsc_policy_set_enable_dsc_when_not_needed(bool enable);
 
+uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
+
 #endif
Signature · 6 lines
2.30.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

Ping?

Quoted 52 lines · Alex Deucher

Move the function protoype to the right header and guard the call with CONFIG_DRM_AMD_DC_DCN as DSC is only available with DCN.

Fixes a03f6c0e26b2 ("drm/amd/display: Add changes for dsc bpp in 16ths and unify bw calculations")
Cc Dillon Varone <[email protected]>
Cc Stephen Rothwell <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 drivers/gpu/drm/amd/display/dc/dc_dsc.h       | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index 10e34e411e06..f9a33dc52c45 100644
@@ -3498,17 +3498,17 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable)
        }
 }
 
-uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
-
 uint32_t dc_bandwidth_in_kbps_from_timing(
        const struct dc_crtc_timing *timing)
 {
        uint32_t bits_per_channel = 0;
        uint32_t kbps;
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
        if (timing->flags.DSC) {
                return dc_dsc_stream_bandwidth_in_kbps(timing->pix_clk_100hz, timing->dsc_cfg.bits_per_pixel);
        }
+#endif
 
        switch (timing->display_color_depth) {
        case COLOR_DEPTH_666:
drivers/gpu/drm/amd/display/dc/dc_dsc.h +2 -1
index 0c5d98524536..c51d2d961b7a 100644
@@ -88,4 +88,6 @@ void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit);
 
 void dc_dsc_policy_set_enable_dsc_when_not_needed(bool enable);
 
+uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
+
 #endif
--

2.30.2

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

maintainer Reviewed-by
#2 lore raw
Quoted 12 lines · Alex Deucher

Ping?

Quoted 9 lines · Alex Deucher

Move the function protoype to the right header and guard the call with CONFIG_DRM_AMD_DC_DCN as DSC is only available with DCN.

Fixes a03f6c0e26b2 ("drm/amd/display: Add changes for dsc bpp in 16ths and unify bw calculations")
Cc Dillon Varone <[email protected]>
Cc Stephen Rothwell <[email protected]>

Harry

Quoted 43 lines
Quoted 43 lines
---
  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
  drivers/gpu/drm/amd/display/dc/dc_dsc.h       | 2 ++
  2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index 10e34e411e06..f9a33dc52c45 100644
@@ -3498,17 +3498,17 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable)
         }
  }
 
-uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
-
  uint32_t dc_bandwidth_in_kbps_from_timing(
         const struct dc_crtc_timing *timing)
  {
         uint32_t bits_per_channel = 0;
         uint32_t kbps;
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
         if (timing->flags.DSC) {
                 return dc_dsc_stream_bandwidth_in_kbps(timing->pix_clk_100hz, timing->dsc_cfg.bits_per_pixel);
         }
+#endif
 
         switch (timing->display_color_depth) {
         case COLOR_DEPTH_666:
drivers/gpu/drm/amd/display/dc/dc_dsc.h +2 -1
index 0c5d98524536..c51d2d961b7a 100644
@@ -88,4 +88,6 @@ void dc_dsc_policy_set_max_target_bpp_limit(uint32_t limit);
 
  void dc_dsc_policy_set_enable_dsc_when_not_needed(bool enable);
 
+uint32_t dc_dsc_stream_bandwidth_in_kbps(uint32_t pix_clk_100hz, uint32_t bpp_x16);
+
  #endif
--

2.30.2

Quoted 7 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx>> _______________________________________________

amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx>>

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx