summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2017-01-19 17:54:39 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:11:51 -0400
commit0be06fc29b31d92a22180deaf866ad5f97133a9e (patch)
treefa4ac58fe810980bdbcaef35cf16ffc63b2e0046
parentdcbd4ee0fabcc1f6a40d67e8a8621e9ac5a382ac (diff)
downloadlinux-stable-0be06fc29b31d92a22180deaf866ad5f97133a9e.tar.gz
linux-stable-0be06fc29b31d92a22180deaf866ad5f97133a9e.zip
drm/amd/display: prevent setting cursor position with no surface
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 47816c5ee0e0..e1f579bcd789 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -232,8 +232,8 @@ bool dc_stream_set_cursor_position(
for (i = 0; i < MAX_PIPES; i++) {
struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
- if ((pipe_ctx->stream == stream) &&
- (pipe_ctx->ipp != NULL)) {
+ if (pipe_ctx->stream == stream &&
+ pipe_ctx->ipp && pipe_ctx->surface) {
struct input_pixel_processor *ipp = pipe_ctx->ipp;
struct dc_cursor_mi_param param = {
.pixel_clk_khz = dc_stream->timing.pix_clk_khz,