* [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
@ 2021-06-01 8:14 ` Baokun Li
0 siblings, 0 replies; 6+ messages in thread
From: Baokun Li @ 2021-06-01 8:14 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
Xinhui.Pan, airlied, daniel, nicholas.kazlauskas,
Rodrigo.Siqueira, aurabindo.pillai, qingqing.zhuo, bas,
nikola.cornij, Wayne.Lin, amd-gfx, dri-devel, linux-kernel
Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1
Fixes gcc '-Wunused-function' warning:
‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
if 'CONFIG_DRM_AMD_DC_DCN' is defined,
however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
Thus gcc will report following warning
if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
‘update_dsc_caps’ defined but not used [-Wunused-function]
Thus move the definition of ‘update_dsc_caps’ and
‘apply_dsc_policy_for_stream’ inside define macro to fix it.
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..e0af394103aa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
}
}
+#if defined(CONFIG_DRM_AMD_DC_DCN)
static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
stream->timing.flags.DSC = 0;
if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
-#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
dsc_caps);
-#endif
}
}
@@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
/* Set DSC policy according to dsc_clock_en */
dc_dsc_policy_set_enable_dsc_when_not_needed(
aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
}
+#endif
static struct drm_display_mode *
get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
@ 2021-06-01 8:14 ` Baokun Li
0 siblings, 0 replies; 6+ messages in thread
From: Baokun Li @ 2021-06-01 8:14 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
Xinhui.Pan, airlied, daniel, nicholas.kazlauskas,
Rodrigo.Siqueira, aurabindo.pillai, qingqing.zhuo, bas,
nikola.cornij, Wayne.Lin, amd-gfx, dri-devel, linux-kernel
Cc: yuehaibing, libaokun1, weiyongjun1, yukuai3, yangjihong1
Fixes gcc '-Wunused-function' warning:
‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
if 'CONFIG_DRM_AMD_DC_DCN' is defined,
however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
Thus gcc will report following warning
if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
‘update_dsc_caps’ defined but not used [-Wunused-function]
Thus move the definition of ‘update_dsc_caps’ and
‘apply_dsc_policy_for_stream’ inside define macro to fix it.
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..e0af394103aa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
}
}
+#if defined(CONFIG_DRM_AMD_DC_DCN)
static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
stream->timing.flags.DSC = 0;
if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
-#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
dsc_caps);
-#endif
}
}
@@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
/* Set DSC policy according to dsc_clock_en */
dc_dsc_policy_set_enable_dsc_when_not_needed(
aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
}
+#endif
static struct drm_display_mode *
get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
@ 2021-06-01 8:14 ` Baokun Li
0 siblings, 0 replies; 6+ messages in thread
From: Baokun Li @ 2021-06-01 8:14 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
Xinhui.Pan, airlied, daniel, nicholas.kazlauskas,
Rodrigo.Siqueira, aurabindo.pillai, qingqing.zhuo, bas,
nikola.cornij, Wayne.Lin, amd-gfx, dri-devel, linux-kernel
Cc: yuehaibing, libaokun1, weiyongjun1, yukuai3, yangjihong1
Fixes gcc '-Wunused-function' warning:
‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
if 'CONFIG_DRM_AMD_DC_DCN' is defined,
however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
Thus gcc will report following warning
if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
‘update_dsc_caps’ defined but not used [-Wunused-function]
Thus move the definition of ‘update_dsc_caps’ and
‘apply_dsc_policy_for_stream’ inside define macro to fix it.
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index f0adfda32213..e0af394103aa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
}
}
+#if defined(CONFIG_DRM_AMD_DC_DCN)
static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps)
@@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
stream->timing.flags.DSC = 0;
if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
-#if defined(CONFIG_DRM_AMD_DC_DCN)
dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
dsc_caps);
-#endif
}
}
@@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
dc_link_get_link_cap(aconnector->dc_link));
-#if defined(CONFIG_DRM_AMD_DC_DCN)
/* Set DSC policy according to dsc_clock_en */
dc_dsc_policy_set_enable_dsc_when_not_needed(
aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
-#endif
}
+#endif
static struct drm_display_mode *
get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
--
2.31.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
2021-06-01 8:14 ` Baokun Li
(?)
@ 2021-06-02 2:10 ` Alex Deucher
-1 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-02 2:10 UTC (permalink / raw)
To: Baokun Li
Cc: Wentland, Harry, Leo (Sunpeng) Li, Deucher, Alexander,
Christian Koenig, xinhui pan, Dave Airlie, Daniel Vetter,
Kazlauskas, Nicholas, Siqueira, Rodrigo, Aurabindo Pillai,
Qingqing Zhuo, Bas Nieuwenhuizen, Nikola Cornij, Wayne Lin,
amd-gfx list, Maling list - DRI developers, LKML, YueHaibing,
Wei Yongjun, yu kuai, yangjihong1
Applied. Thanks!
On Tue, Jun 1, 2021 at 4:04 AM Baokun Li <libaokun1@huawei.com> wrote:
>
> Fixes gcc '-Wunused-function' warning:
>
> ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
> if 'CONFIG_DRM_AMD_DC_DCN' is defined,
>
> however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
> Thus gcc will report following warning
> if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
> ‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
> ‘update_dsc_caps’ defined but not used [-Wunused-function]
>
> Thus move the definition of ‘update_dsc_caps’ and
> ‘apply_dsc_policy_for_stream’ inside define macro to fix it.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f0adfda32213..e0af394103aa 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
> }
> }
>
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> struct dc_sink *sink, struct dc_stream_state *stream,
> struct dsc_dec_dpcd_caps *dsc_caps)
> @@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> stream->timing.flags.DSC = 0;
>
> if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
> dsc_caps);
> -#endif
> }
> }
>
> @@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
> dc_link_get_link_cap(aconnector->dc_link));
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> /* Set DSC policy according to dsc_clock_en */
> dc_dsc_policy_set_enable_dsc_when_not_needed(
> aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
> @@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
> stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
> -#endif
> }
> +#endif
>
> static struct drm_display_mode *
> get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
@ 2021-06-02 2:10 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-02 2:10 UTC (permalink / raw)
To: Baokun Li
Cc: Wayne Lin, Leo (Sunpeng) Li, YueHaibing, Qingqing Zhuo,
xinhui pan, Siqueira, Rodrigo, LKML, amd-gfx list, Kazlauskas,
Nicholas, Dave Airlie, Aurabindo Pillai, Wei Yongjun,
Maling list - DRI developers, Deucher, Alexander, yu kuai,
yangjihong1, Nikola Cornij, Christian Koenig
Applied. Thanks!
On Tue, Jun 1, 2021 at 4:04 AM Baokun Li <libaokun1@huawei.com> wrote:
>
> Fixes gcc '-Wunused-function' warning:
>
> ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
> if 'CONFIG_DRM_AMD_DC_DCN' is defined,
>
> however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
> Thus gcc will report following warning
> if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
> ‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
> ‘update_dsc_caps’ defined but not used [-Wunused-function]
>
> Thus move the definition of ‘update_dsc_caps’ and
> ‘apply_dsc_policy_for_stream’ inside define macro to fix it.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f0adfda32213..e0af394103aa 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
> }
> }
>
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> struct dc_sink *sink, struct dc_stream_state *stream,
> struct dsc_dec_dpcd_caps *dsc_caps)
> @@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> stream->timing.flags.DSC = 0;
>
> if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
> dsc_caps);
> -#endif
> }
> }
>
> @@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
> dc_link_get_link_cap(aconnector->dc_link));
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> /* Set DSC policy according to dsc_clock_en */
> dc_dsc_policy_set_enable_dsc_when_not_needed(
> aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
> @@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
> stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
> -#endif
> }
> +#endif
>
> static struct drm_display_mode *
> get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
@ 2021-06-02 2:10 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-06-02 2:10 UTC (permalink / raw)
To: Baokun Li
Cc: Wayne Lin, Leo (Sunpeng) Li, YueHaibing, Qingqing Zhuo,
xinhui pan, Siqueira, Rodrigo, LKML, amd-gfx list, Kazlauskas,
Nicholas, Dave Airlie, Aurabindo Pillai, Wei Yongjun,
Maling list - DRI developers, Daniel Vetter, Bas Nieuwenhuizen,
Deucher, Alexander, yu kuai, yangjihong1, Nikola Cornij,
Wentland, Harry, Christian Koenig
Applied. Thanks!
On Tue, Jun 1, 2021 at 4:04 AM Baokun Li <libaokun1@huawei.com> wrote:
>
> Fixes gcc '-Wunused-function' warning:
>
> ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ are only used
> if 'CONFIG_DRM_AMD_DC_DCN' is defined,
>
> however, it's defined even if 'CONFIG_DRM_AMD_DC_DCN' is not defined.
> Thus gcc will report following warning
> if 'CONFIG_DRM_AMD_DC_DCN' is not defined:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5572:13: warning:
> ‘apply_dsc_policy_for_stream’ defined but not used [-Wunused-function]
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5556:13: warning:
> ‘update_dsc_caps’ defined but not used [-Wunused-function]
>
> Thus move the definition of ‘update_dsc_caps’ and
> ‘apply_dsc_policy_for_stream’ inside define macro to fix it.
>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index f0adfda32213..e0af394103aa 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -5553,6 +5553,7 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
> }
> }
>
> +#if defined(CONFIG_DRM_AMD_DC_DCN)
> static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> struct dc_sink *sink, struct dc_stream_state *stream,
> struct dsc_dec_dpcd_caps *dsc_caps)
> @@ -5560,12 +5561,10 @@ static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
> stream->timing.flags.DSC = 0;
>
> if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
> aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
> dsc_caps);
> -#endif
> }
> }
>
> @@ -5578,7 +5577,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
> dc_link_get_link_cap(aconnector->dc_link));
> -#if defined(CONFIG_DRM_AMD_DC_DCN)
> /* Set DSC policy according to dsc_clock_en */
> dc_dsc_policy_set_enable_dsc_when_not_needed(
> aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
> @@ -5609,8 +5607,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
>
> if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
> stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
> -#endif
> }
> +#endif
>
> static struct drm_display_mode *
> get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
> --
> 2.31.1
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-06-02 2:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 8:14 [PATCH -next] drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used Baokun Li
2021-06-01 8:14 ` Baokun Li
2021-06-01 8:14 ` Baokun Li
2021-06-02 2:10 ` Alex Deucher
2021-06-02 2:10 ` Alex Deucher
2021-06-02 2:10 ` Alex Deucher
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.