AMD-GFX Archive on lore.kernel.org
 help / color / Atom feed
* [bug report] drm/amd/display: Use dmub fw to lock pipe, cursor, dig
@ 2020-06-26 10:06 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-06-26 10:06 UTC (permalink / raw)
  To: wyatt.wood; +Cc: amd-gfx

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 10:06 [bug report] drm/amd/display: Use dmub fw to lock pipe, cursor, dig Dan Carpenter

AMD-GFX Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/amd-gfx/0 amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ https://lore.kernel.org/amd-gfx \
		amd-gfx@lists.freedesktop.org
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.amd-gfx


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git