Commit b3fb2b4e authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Fix hubp check in set_cursor_position

Found by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:298
dc_stream_set_cursor_position() error: we previously assumed 'hubp'
could be null (see line 294)
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b001965d
...@@ -263,7 +263,6 @@ bool dc_stream_set_cursor_position( ...@@ -263,7 +263,6 @@ bool dc_stream_set_cursor_position(
struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp; struct input_pixel_processor *ipp = pipe_ctx->plane_res.ipp;
struct mem_input *mi = pipe_ctx->plane_res.mi; struct mem_input *mi = pipe_ctx->plane_res.mi;
struct hubp *hubp = pipe_ctx->plane_res.hubp; struct hubp *hubp = pipe_ctx->plane_res.hubp;
struct transform *xfm = pipe_ctx->plane_res.xfm;
struct dpp *dpp = pipe_ctx->plane_res.dpp; struct dpp *dpp = pipe_ctx->plane_res.dpp;
struct dc_cursor_position pos_cpy = *position; struct dc_cursor_position pos_cpy = *position;
struct dc_cursor_mi_param param = { struct dc_cursor_mi_param param = {
...@@ -294,11 +293,11 @@ bool dc_stream_set_cursor_position( ...@@ -294,11 +293,11 @@ bool dc_stream_set_cursor_position(
if (mi != NULL && mi->funcs->set_cursor_position != NULL) if (mi != NULL && mi->funcs->set_cursor_position != NULL)
mi->funcs->set_cursor_position(mi, &pos_cpy, &param); mi->funcs->set_cursor_position(mi, &pos_cpy, &param);
if (hubp != NULL && hubp->funcs->set_cursor_position != NULL) if (!hubp)
hubp->funcs->set_cursor_position(hubp, &pos_cpy, &param); continue;
if (xfm != NULL && xfm->funcs->set_cursor_position != NULL) if (hubp->funcs->set_cursor_position != NULL)
xfm->funcs->set_cursor_position(xfm, &pos_cpy, &param, hubp->curs_attr.width); hubp->funcs->set_cursor_position(hubp, &pos_cpy, &param);
if (dpp != NULL && dpp->funcs->set_cursor_position != NULL) if (dpp != NULL && dpp->funcs->set_cursor_position != NULL)
dpp->funcs->set_cursor_position(dpp, &pos_cpy, &param, hubp->curs_attr.width); dpp->funcs->set_cursor_position(dpp, &pos_cpy, &param, hubp->curs_attr.width);
......
...@@ -259,13 +259,6 @@ struct transform_funcs { ...@@ -259,13 +259,6 @@ struct transform_funcs {
struct transform *xfm_base, struct transform *xfm_base,
const struct dc_cursor_attributes *attr); const struct dc_cursor_attributes *attr);
void (*set_cursor_position)(
struct transform *xfm_base,
const struct dc_cursor_position *pos,
const struct dc_cursor_mi_param *param,
uint32_t width
);
}; };
const uint16_t *get_filter_2tap_16p(void); const uint16_t *get_filter_2tap_16p(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment