Skip to content

Commit

Permalink
drm/amdgpu/display: Protect some functions with CONFIG_DRM_AMD_DC_DCN
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Deucher committed Jun 3, 2022
1 parent 3e80a5b commit d8e4fb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/display/dc/core/dc_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1801,13 +1801,15 @@ static inline void retain_hpo_dp_link_enc(
res_ctx->hpo_dp_link_enc_ref_cnts[enc_index]++;
}

#if defined(CONFIG_DRM_AMD_DC_DCN)
static inline void release_hpo_dp_link_enc(
struct resource_context *res_ctx,
int enc_index)
{
ASSERT(res_ctx->hpo_dp_link_enc_ref_cnts[enc_index] > 0);
res_ctx->hpo_dp_link_enc_ref_cnts[enc_index]--;
}
#endif

static bool add_hpo_dp_link_enc_to_ctx(struct resource_context *res_ctx,
const struct resource_pool *pool,
Expand All @@ -1832,6 +1834,7 @@ static bool add_hpo_dp_link_enc_to_ctx(struct resource_context *res_ctx,
return pipe_ctx->link_res.hpo_dp_link_enc != NULL;
}

#if defined(CONFIG_DRM_AMD_DC_DCN)
static void remove_hpo_dp_link_enc_from_ctx(struct resource_context *res_ctx,
struct pipe_ctx *pipe_ctx,
struct dc_stream_state *stream)
Expand All @@ -1845,6 +1848,7 @@ static void remove_hpo_dp_link_enc_from_ctx(struct resource_context *res_ctx,
pipe_ctx->link_res.hpo_dp_link_enc = NULL;
}
}
#endif

/* TODO: release audio object */
void update_audio_usage(
Expand Down

0 comments on commit d8e4fb9

Please sign in to comment.