From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [drm-misc:drm-misc-next 32/48] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_connector.c:3322 amdgpu_dm_connector_init_helper() error: we previously assumed 'aconnector->base.state' could be null (see line 3230)
Date: Sat, 07 Nov 2026 05:27:32 +0100 [thread overview]
Message-ID: <202611070550.m6aIjVTi-lkp@intel.com> (raw)
Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: dri-devel@lists.freedesktop.org
TO: Maxime Ripard <mripard@kernel.org>
CC: Leo Li <sunpeng.li@amd.com>
CC: Thomas Zimmermann <tzimmermann@suse.de>
tree: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
head: 2d5a8313d9cf989b8f53a5689a96e891bf99fb2c
commit: efb3523ce260fbb7b89c870bc2c31c384ec98a9e [32/48] drm/amdgpu: dm: Convert to atomic_create_state
:::::: branch date: 9 hours ago
:::::: commit date: 2 days ago
config: loongarch-randconfig-2200-20261106 (https://download.01.org/0day-ci/archive/20261107/202611070550.m6aIjVTi-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 0fa861dbbf46e5a75f621406fd91cb015d8754bf)
smatch: v0.5.0-9187-g5189e3fb
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202611070550.m6aIjVTi-lkp@intel.com/
smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_connector.c:3322 amdgpu_dm_connector_init_helper() error: we previously assumed 'aconnector->base.state' could be null (see line 3230)
vim +3322 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_connector.c
0e967e086e7519 Alex Hung 2026-04-27 3217
0e967e086e7519 Alex Hung 2026-04-27 3218 void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
0e967e086e7519 Alex Hung 2026-04-27 3219 struct amdgpu_dm_connector *aconnector,
0e967e086e7519 Alex Hung 2026-04-27 3220 int connector_type,
0e967e086e7519 Alex Hung 2026-04-27 3221 struct dc_link *link,
0e967e086e7519 Alex Hung 2026-04-27 3222 int link_index)
0e967e086e7519 Alex Hung 2026-04-27 3223 {
0e967e086e7519 Alex Hung 2026-04-27 3224 struct amdgpu_device *adev = drm_to_adev(dm->ddev);
0e967e086e7519 Alex Hung 2026-04-27 3225
0e967e086e7519 Alex Hung 2026-04-27 3226 /*
0e967e086e7519 Alex Hung 2026-04-27 3227 * Some of the properties below require access to state, like bpc.
0e967e086e7519 Alex Hung 2026-04-27 3228 * Allocate some default initial connector state with our reset helper.
0e967e086e7519 Alex Hung 2026-04-27 3229 */
efb3523ce260fb Maxime Ripard 2026-10-30 @3230 if (!aconnector->base.state &&
efb3523ce260fb Maxime Ripard 2026-10-30 3231 aconnector->base.funcs->atomic_create_state) {
efb3523ce260fb Maxime Ripard 2026-10-30 3232 struct drm_connector_state *conn_state;
efb3523ce260fb Maxime Ripard 2026-10-30 3233
efb3523ce260fb Maxime Ripard 2026-10-30 3234 conn_state = aconnector->base.funcs->atomic_create_state(&aconnector->base);
efb3523ce260fb Maxime Ripard 2026-10-30 3235 if (IS_ERR(conn_state))
efb3523ce260fb Maxime Ripard 2026-10-30 3236 return;
efb3523ce260fb Maxime Ripard 2026-10-30 3237
efb3523ce260fb Maxime Ripard 2026-10-30 3238 aconnector->base.state = conn_state;
efb3523ce260fb Maxime Ripard 2026-10-30 3239 }
0e967e086e7519 Alex Hung 2026-04-27 3240
0e967e086e7519 Alex Hung 2026-04-27 3241 aconnector->connector_id = link_index;
0e967e086e7519 Alex Hung 2026-04-27 3242 aconnector->bl_idx = -1;
0e967e086e7519 Alex Hung 2026-04-27 3243 aconnector->dc_link = link;
0e967e086e7519 Alex Hung 2026-04-27 3244 aconnector->base.interlace_allowed = false;
0e967e086e7519 Alex Hung 2026-04-27 3245 aconnector->base.doublescan_allowed = false;
0e967e086e7519 Alex Hung 2026-04-27 3246 aconnector->base.stereo_allowed = false;
0e967e086e7519 Alex Hung 2026-04-27 3247 aconnector->base.dpms = DRM_MODE_DPMS_OFF;
0e967e086e7519 Alex Hung 2026-04-27 3248 aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */
0e967e086e7519 Alex Hung 2026-04-27 3249 aconnector->audio_inst = -1;
0e967e086e7519 Alex Hung 2026-04-27 3250 aconnector->pack_sdp_v1_3 = false;
0e967e086e7519 Alex Hung 2026-04-27 3251 aconnector->as_type = ADAPTIVE_SYNC_TYPE_NONE;
0e967e086e7519 Alex Hung 2026-04-27 3252 memset(&aconnector->vsdb_info, 0, sizeof(aconnector->vsdb_info));
0e967e086e7519 Alex Hung 2026-04-27 3253 mutex_init(&aconnector->hpd_lock);
0e967e086e7519 Alex Hung 2026-04-27 3254 mutex_init(&aconnector->handle_mst_msg_ready);
0e967e086e7519 Alex Hung 2026-04-27 3255
0e967e086e7519 Alex Hung 2026-04-27 3256 /*
0e967e086e7519 Alex Hung 2026-04-27 3257 * If HDMI HPD debounce delay is set, use the minimum between selected
0e967e086e7519 Alex Hung 2026-04-27 3258 * value and AMDGPU_DM_MAX_HDMI_HPD_DEBOUNCE_MS
0e967e086e7519 Alex Hung 2026-04-27 3259 */
0e967e086e7519 Alex Hung 2026-04-27 3260 if (amdgpu_hdmi_hpd_debounce_delay_ms) {
0e967e086e7519 Alex Hung 2026-04-27 3261 aconnector->hdmi_hpd_debounce_delay_ms = min(amdgpu_hdmi_hpd_debounce_delay_ms,
0e967e086e7519 Alex Hung 2026-04-27 3262 AMDGPU_DM_MAX_HDMI_HPD_DEBOUNCE_MS);
0e967e086e7519 Alex Hung 2026-04-27 3263 INIT_DELAYED_WORK(&aconnector->hdmi_hpd_debounce_work, amdgpu_dm_hdmi_hpd_debounce_work);
0e967e086e7519 Alex Hung 2026-04-27 3264 aconnector->hdmi_prev_sink = NULL;
0e967e086e7519 Alex Hung 2026-04-27 3265 } else {
0e967e086e7519 Alex Hung 2026-04-27 3266 aconnector->hdmi_hpd_debounce_delay_ms = 0;
0e967e086e7519 Alex Hung 2026-04-27 3267 }
0e967e086e7519 Alex Hung 2026-04-27 3268
0e967e086e7519 Alex Hung 2026-04-27 3269 dm->hdmi_frl_status_polling_delay_ms = 200;
0e967e086e7519 Alex Hung 2026-04-27 3270 INIT_DELAYED_WORK(&dm->hdmi_frl_status_polling_work, hdmi_frl_status_polling_work);
0e967e086e7519 Alex Hung 2026-04-27 3271 /*
0e967e086e7519 Alex Hung 2026-04-27 3272 * configure support HPD hot plug connector_>polled default value is 0
0e967e086e7519 Alex Hung 2026-04-27 3273 * which means HPD hot plug not supported
0e967e086e7519 Alex Hung 2026-04-27 3274 */
0e967e086e7519 Alex Hung 2026-04-27 3275 switch (connector_type) {
0e967e086e7519 Alex Hung 2026-04-27 3276 case DRM_MODE_CONNECTOR_HDMIA:
0e967e086e7519 Alex Hung 2026-04-27 3277 aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
0e967e086e7519 Alex Hung 2026-04-27 3278 aconnector->base.ycbcr_420_allowed =
0e967e086e7519 Alex Hung 2026-04-27 3279 link->link_enc->features.hdmi_ycbcr420_supported ? true : false;
0e967e086e7519 Alex Hung 2026-04-27 3280 break;
0e967e086e7519 Alex Hung 2026-04-27 3281 case DRM_MODE_CONNECTOR_DisplayPort:
0e967e086e7519 Alex Hung 2026-04-27 3282 aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
0e967e086e7519 Alex Hung 2026-04-27 3283 link->link_enc = link_enc_cfg_get_link_enc(link);
0e967e086e7519 Alex Hung 2026-04-27 3284 ASSERT(link->link_enc);
0e967e086e7519 Alex Hung 2026-04-27 3285 if (link->link_enc)
0e967e086e7519 Alex Hung 2026-04-27 3286 aconnector->base.ycbcr_420_allowed =
0e967e086e7519 Alex Hung 2026-04-27 3287 link->link_enc->features.dp_ycbcr420_supported ? true : false;
0e967e086e7519 Alex Hung 2026-04-27 3288 break;
0e967e086e7519 Alex Hung 2026-04-27 3289 case DRM_MODE_CONNECTOR_DVID:
0e967e086e7519 Alex Hung 2026-04-27 3290 aconnector->base.polled = DRM_CONNECTOR_POLL_HPD;
0e967e086e7519 Alex Hung 2026-04-27 3291 break;
0e967e086e7519 Alex Hung 2026-04-27 3292 case DRM_MODE_CONNECTOR_DVII:
0e967e086e7519 Alex Hung 2026-04-27 3293 case DRM_MODE_CONNECTOR_VGA:
0e967e086e7519 Alex Hung 2026-04-27 3294 aconnector->base.polled =
0e967e086e7519 Alex Hung 2026-04-27 3295 DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
0e967e086e7519 Alex Hung 2026-04-27 3296 break;
0e967e086e7519 Alex Hung 2026-04-27 3297 default:
0e967e086e7519 Alex Hung 2026-04-27 3298 break;
0e967e086e7519 Alex Hung 2026-04-27 3299 }
0e967e086e7519 Alex Hung 2026-04-27 3300
0e967e086e7519 Alex Hung 2026-04-27 3301 drm_object_attach_property(&aconnector->base.base,
0e967e086e7519 Alex Hung 2026-04-27 3302 dm->ddev->mode_config.scaling_mode_property,
0e967e086e7519 Alex Hung 2026-04-27 3303 DRM_MODE_SCALE_NONE);
0e967e086e7519 Alex Hung 2026-04-27 3304
0e967e086e7519 Alex Hung 2026-04-27 3305 if (connector_type == DRM_MODE_CONNECTOR_HDMIA
0e967e086e7519 Alex Hung 2026-04-27 3306 || (connector_type == DRM_MODE_CONNECTOR_DisplayPort && !aconnector->mst_root))
0e967e086e7519 Alex Hung 2026-04-27 3307 drm_connector_attach_broadcast_rgb_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3308
0e967e086e7519 Alex Hung 2026-04-27 3309 drm_object_attach_property(&aconnector->base.base,
0e967e086e7519 Alex Hung 2026-04-27 3310 adev->mode_info.underscan_property,
0e967e086e7519 Alex Hung 2026-04-27 3311 UNDERSCAN_OFF);
0e967e086e7519 Alex Hung 2026-04-27 3312 drm_object_attach_property(&aconnector->base.base,
0e967e086e7519 Alex Hung 2026-04-27 3313 adev->mode_info.underscan_hborder_property,
0e967e086e7519 Alex Hung 2026-04-27 3314 0);
0e967e086e7519 Alex Hung 2026-04-27 3315 drm_object_attach_property(&aconnector->base.base,
0e967e086e7519 Alex Hung 2026-04-27 3316 adev->mode_info.underscan_vborder_property,
0e967e086e7519 Alex Hung 2026-04-27 3317 0);
0e967e086e7519 Alex Hung 2026-04-27 3318
0e967e086e7519 Alex Hung 2026-04-27 3319 if (!aconnector->mst_root)
0e967e086e7519 Alex Hung 2026-04-27 3320 drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16);
0e967e086e7519 Alex Hung 2026-04-27 3321
0e967e086e7519 Alex Hung 2026-04-27 @3322 aconnector->base.state->max_bpc = 16;
0e967e086e7519 Alex Hung 2026-04-27 3323 aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;
0e967e086e7519 Alex Hung 2026-04-27 3324
0e967e086e7519 Alex Hung 2026-04-27 3325 if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
0e967e086e7519 Alex Hung 2026-04-27 3326 /* Content Type is currently only implemented for HDMI. */
0e967e086e7519 Alex Hung 2026-04-27 3327 drm_connector_attach_content_type_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3328 }
0e967e086e7519 Alex Hung 2026-04-27 3329
0e967e086e7519 Alex Hung 2026-04-27 3330 if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
0e967e086e7519 Alex Hung 2026-04-27 3331 if (!drm_mode_create_hdmi_colorspace_property(&aconnector->base, supported_colorspaces))
0e967e086e7519 Alex Hung 2026-04-27 3332 drm_connector_attach_colorspace_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3333 } else if ((connector_type == DRM_MODE_CONNECTOR_DisplayPort && !aconnector->mst_root) ||
0e967e086e7519 Alex Hung 2026-04-27 3334 connector_type == DRM_MODE_CONNECTOR_eDP) {
0e967e086e7519 Alex Hung 2026-04-27 3335 if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))
0e967e086e7519 Alex Hung 2026-04-27 3336 drm_connector_attach_colorspace_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3337 }
0e967e086e7519 Alex Hung 2026-04-27 3338
0e967e086e7519 Alex Hung 2026-04-27 3339 if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
0e967e086e7519 Alex Hung 2026-04-27 3340 connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
0e967e086e7519 Alex Hung 2026-04-27 3341 connector_type == DRM_MODE_CONNECTOR_eDP) {
0e967e086e7519 Alex Hung 2026-04-27 3342 drm_connector_attach_hdr_output_metadata_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3343
0461ba9a7994a9 Dave Airlie 2026-07-07 3344 if (!aconnector->mst_root) {
0e967e086e7519 Alex Hung 2026-04-27 3345 drm_connector_attach_vrr_capable_property(&aconnector->base);
0461ba9a7994a9 Dave Airlie 2026-07-07 3346 drm_connector_attach_color_format_property(&aconnector->base,
0461ba9a7994a9 Dave Airlie 2026-07-07 3347 supported_colorformats);
0461ba9a7994a9 Dave Airlie 2026-07-07 3348 }
0e967e086e7519 Alex Hung 2026-04-27 3349
0e967e086e7519 Alex Hung 2026-04-27 3350
0e967e086e7519 Alex Hung 2026-04-27 3351 if (adev->dm.hdcp_workqueue)
0e967e086e7519 Alex Hung 2026-04-27 3352 drm_connector_attach_content_protection_property(&aconnector->base, true);
0e967e086e7519 Alex Hung 2026-04-27 3353 }
0e967e086e7519 Alex Hung 2026-04-27 3354
0e967e086e7519 Alex Hung 2026-04-27 3355 if (connector_type == DRM_MODE_CONNECTOR_eDP) {
0e967e086e7519 Alex Hung 2026-04-27 3356 struct drm_privacy_screen *privacy_screen;
0e967e086e7519 Alex Hung 2026-04-27 3357
0e967e086e7519 Alex Hung 2026-04-27 3358 drm_connector_attach_panel_type_property(&aconnector->base);
0e967e086e7519 Alex Hung 2026-04-27 3359
0e967e086e7519 Alex Hung 2026-04-27 3360 privacy_screen = drm_privacy_screen_get(adev_to_drm(adev)->dev, NULL);
0e967e086e7519 Alex Hung 2026-04-27 3361 if (!IS_ERR(privacy_screen)) {
0e967e086e7519 Alex Hung 2026-04-27 3362 drm_connector_attach_privacy_screen_provider(&aconnector->base,
0e967e086e7519 Alex Hung 2026-04-27 3363 privacy_screen);
0e967e086e7519 Alex Hung 2026-04-27 3364 } else if (PTR_ERR(privacy_screen) != -ENODEV) {
0e967e086e7519 Alex Hung 2026-04-27 3365 drm_warn(adev_to_drm(adev), "Error getting privacy-screen\n");
0e967e086e7519 Alex Hung 2026-04-27 3366 }
0e967e086e7519 Alex Hung 2026-04-27 3367 }
0e967e086e7519 Alex Hung 2026-04-27 3368 }
94be315afbd42b Alex Hung 2026-08-29 3369 EXPORT_IF_KUNIT(amdgpu_dm_connector_init_helper);
0e967e086e7519 Alex Hung 2026-04-27 3370
:::::: The code at line 3322 was first introduced by commit
:::::: 0e967e086e7519966816b76a6309b4516d365aa5 drm/amd/display: Extract connector and encoder code to amdgpu_dm_connector
:::::: TO: Alex Hung <alex.hung@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-07 4:27 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=202611070550.m6aIjVTi-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/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.