amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [bug report] drm/amd/display: Add connector to the state if DSC debugfs is set
@ 2020-09-18 14:28 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-09-18 14:28 UTC (permalink / raw)
  To: eryk.brol; +Cc: amd-gfx

Hello Eryk Brol,

The patch c44a22b3128d: "drm/amd/display: Add connector to the state
if DSC debugfs is set" from Aug 27, 2020, leads to the following
static checker warning:

	drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:917 amdgpu_check_debugfs_connector_property_change()
	error: 'crtc_state' dereferencing possible ERR_PTR()

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c
   883  static void amdgpu_check_debugfs_connector_property_change(struct amdgpu_device *adev,
   884                                                             struct drm_atomic_state *state)
   885  {
   886          struct drm_connector *connector;
   887          struct drm_crtc *crtc;
   888          struct amdgpu_dm_connector *amdgpu_dm_connector;
   889          struct drm_connector_state *conn_state;
   890          struct dm_crtc_state *acrtc_state;
   891          struct drm_crtc_state *crtc_state;
   892          struct dc_stream_state *stream;
   893          struct drm_device *dev = adev_to_drm(adev);
   894  
   895          list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
   896  
   897                  amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
   898                  conn_state = connector->state;
   899  
   900                  if (!(conn_state && conn_state->crtc))
   901                          continue;
   902  
   903                  crtc = conn_state->crtc;
   904                  acrtc_state = to_dm_crtc_state(crtc->state);
   905  
   906                  if (!(acrtc_state && acrtc_state->stream))
   907                          continue;
   908  
   909                  stream = acrtc_state->stream;
   910  
   911                  if (amdgpu_dm_connector->dsc_settings.dsc_force_enable ||
   912                      amdgpu_dm_connector->dsc_settings.dsc_num_slices_v ||
   913                      amdgpu_dm_connector->dsc_settings.dsc_num_slices_h ||
   914                      amdgpu_dm_connector->dsc_settings.dsc_bits_per_pixel) {
   915                          conn_state = drm_atomic_get_connector_state(state, connector);
   916                          crtc_state = drm_atomic_get_crtc_state(state, crtc);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check for errors?

   917                          crtc_state->mode_changed = true;
   918                  }
   919          }
   920  }

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, other threads:[~2020-09-18 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 14:28 [bug report] drm/amd/display: Add connector to the state if DSC debugfs is set Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).