From: Dan Carpenter <dan.carpenter@oracle.com>
To: wyatt.wood@amd.com
Cc: amd-gfx@lists.freedesktop.org
Subject: [bug report] drm/amd/display: Use dmub fw to lock pipe, cursor, dig
Date: Fri, 26 Jun 2020 13:06:12 +0300 [thread overview]
Message-ID: <20200626100612.GA306909@mwanda> (raw)
Hello Wyatt Wood,
This is a semi-automatic email about new static checker warnings.
The patch 4dc079787b23: "drm/amd/display: Use dmub fw to lock pipe,
cursor, dig" from May 27, 2020, leads to the following Smatch
complaint:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:4091 dc_link_dp_set_test_pattern()
warn: variable dereferenced before check 'pipe_ctx->stream' (see line 4068)
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c
4067 color_space,
4068 pipe_ctx->stream->use_vsc_sdp_for_colorimetry,
4069 link->dpcd_caps.dprx_feature.bits.SST_SPLIT_SDP_CAP);
4070
4071 if (pipe_ctx->stream->use_vsc_sdp_for_colorimetry) {
^^^^^^^^^^^^^^^^^^
This is dereferenced in the original code.
4072 if (test_pattern == DP_TEST_PATTERN_COLOR_SQUARES_CEA)
4073 pipe_ctx->stream->vsc_infopacket.sb[17] |= (1 << 7); // sb17 bit 7 Dynamic Range: 0 = VESA range, 1 = CTA range
4074 else
4075 pipe_ctx->stream->vsc_infopacket.sb[17] &= ~(1 << 7);
4076 resource_build_info_frame(pipe_ctx);
4077 link->dc->hwss.update_info_frame(pipe_ctx);
4078 }
4079
4080 /* CRTC Patterns */
4081 set_crtc_test_pattern(link, pipe_ctx, test_pattern, test_pattern_color_space);
4082 pipe_ctx->stream_res.tg->funcs->unlock(pipe_ctx->stream_res.tg);
4083 pipe_ctx->stream_res.tg->funcs->wait_for_state(pipe_ctx->stream_res.tg,
4084 CRTC_STATE_VACTIVE);
4085 pipe_ctx->stream_res.tg->funcs->wait_for_state(pipe_ctx->stream_res.tg,
4086 CRTC_STATE_VBLANK);
4087 pipe_ctx->stream_res.tg->funcs->wait_for_state(pipe_ctx->stream_res.tg,
4088 CRTC_STATE_VACTIVE);
4089
4090 if (pipe_ctx->stream_res.tg->funcs->lock_doublebuffer_disable) {
4091 if (pipe_ctx->stream && should_use_dmub_lock(pipe_ctx->stream->link)) {
^^^^^^^^^^^^^^^^
The patch adds a new dereference, is it really required?
4092 union dmub_hw_lock_flags hw_locks = { 0 };
4093 struct dmub_hw_lock_inst_flags inst_flags = { 0 };
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
reply other threads:[~2020-06-26 10:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200626100612.GA306909@mwanda \
--to=dan.carpenter@oracle.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=wyatt.wood@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.