Skip to content

Commit ea2be5c

Browse files
LiBaokun96alexdeucher
authored andcommitted
drm/amd/display: fix warning: ‘update_dsc_caps’ and ‘apply_dsc_policy_for_stream’ defined but not used
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 <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d3892e2 commit ea2be5c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5543,19 +5543,18 @@ static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
55435543
}
55445544
}
55455545

5546+
#if defined(CONFIG_DRM_AMD_DC_DCN)
55465547
static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
55475548
struct dc_sink *sink, struct dc_stream_state *stream,
55485549
struct dsc_dec_dpcd_caps *dsc_caps)
55495550
{
55505551
stream->timing.flags.DSC = 0;
55515552

55525553
if (aconnector->dc_link && sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT) {
5553-
#if defined(CONFIG_DRM_AMD_DC_DCN)
55545554
dc_dsc_parse_dsc_dpcd(aconnector->dc_link->ctx->dc,
55555555
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_basic_caps.raw,
55565556
aconnector->dc_link->dpcd_caps.dsc_caps.dsc_branch_decoder_caps.raw,
55575557
dsc_caps);
5558-
#endif
55595558
}
55605559
}
55615560

@@ -5568,7 +5567,6 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
55685567

55695568
link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
55705569
dc_link_get_link_cap(aconnector->dc_link));
5571-
#if defined(CONFIG_DRM_AMD_DC_DCN)
55725570
/* Set DSC policy according to dsc_clock_en */
55735571
dc_dsc_policy_set_enable_dsc_when_not_needed(
55745572
aconnector->dsc_settings.dsc_force_enable == DSC_CLK_FORCE_ENABLE);
@@ -5599,8 +5597,8 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
55995597

56005598
if (stream->timing.flags.DSC && aconnector->dsc_settings.dsc_bits_per_pixel)
56015599
stream->timing.dsc_cfg.bits_per_pixel = aconnector->dsc_settings.dsc_bits_per_pixel;
5602-
#endif
56035600
}
5601+
#endif
56045602

56055603
static struct drm_display_mode *
56065604
get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,

0 commit comments

Comments
 (0)