Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/display: Protect some functions with CONFIG_DRM_AMD_DC_DCN

Protect remove_hpo_dp_link_enc_from_ctx() and release_hpo_dp_link_enc()
with CONFIG_DRM_AMD_DC_DCN as the functions are only called from code
that is protected by CONFIG_DRM_AMD_DC_DCN. Fixes build fail with
-Werror=unused-function.

Fixes: 9b0e0d433f74 ("drm/amd/display: Add dependant changes for DCN32/321")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>

+4
+4
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 1801 1801 res_ctx->hpo_dp_link_enc_ref_cnts[enc_index]++; 1802 1802 } 1803 1803 1804 + #if defined(CONFIG_DRM_AMD_DC_DCN) 1804 1805 static inline void release_hpo_dp_link_enc( 1805 1806 struct resource_context *res_ctx, 1806 1807 int enc_index) ··· 1809 1808 ASSERT(res_ctx->hpo_dp_link_enc_ref_cnts[enc_index] > 0); 1810 1809 res_ctx->hpo_dp_link_enc_ref_cnts[enc_index]--; 1811 1810 } 1811 + #endif 1812 1812 1813 1813 static bool add_hpo_dp_link_enc_to_ctx(struct resource_context *res_ctx, 1814 1814 const struct resource_pool *pool, ··· 1834 1832 return pipe_ctx->link_res.hpo_dp_link_enc != NULL; 1835 1833 } 1836 1834 1835 + #if defined(CONFIG_DRM_AMD_DC_DCN) 1837 1836 static void remove_hpo_dp_link_enc_from_ctx(struct resource_context *res_ctx, 1838 1837 struct pipe_ctx *pipe_ctx, 1839 1838 struct dc_stream_state *stream) ··· 1848 1845 pipe_ctx->link_res.hpo_dp_link_enc = NULL; 1849 1846 } 1850 1847 } 1848 + #endif 1851 1849 1852 1850 /* TODO: release audio object */ 1853 1851 void update_audio_usage(