Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-intel-next-fixes-2023-08-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- Fix TLB invalidation (Alan)
- Fix Display HPD polling (Imre)

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZOdOP31OE/Cf1ojo@intel.com

+50 -25
+46 -22
drivers/gpu/drm/drm_probe_helper.c
··· 262 262 } 263 263 264 264 #define DRM_OUTPUT_POLL_PERIOD (10*HZ) 265 + static void reschedule_output_poll_work(struct drm_device *dev) 266 + { 267 + unsigned long delay = DRM_OUTPUT_POLL_PERIOD; 268 + 269 + if (dev->mode_config.delayed_event) 270 + /* 271 + * FIXME: 272 + * 273 + * Use short (1s) delay to handle the initial delayed event. 274 + * This delay should not be needed, but Optimus/nouveau will 275 + * fail in a mysterious way if the delayed event is handled as 276 + * soon as possible like it is done in 277 + * drm_helper_probe_single_connector_modes() in case the poll 278 + * was enabled before. 279 + */ 280 + delay = HZ; 281 + 282 + schedule_delayed_work(&dev->mode_config.output_poll_work, delay); 283 + } 284 + 265 285 /** 266 286 * drm_kms_helper_poll_enable - re-enable output polling. 267 287 * @dev: drm_device ··· 299 279 */ 300 280 void drm_kms_helper_poll_enable(struct drm_device *dev) 301 281 { 302 - bool poll = false; 303 - unsigned long delay = DRM_OUTPUT_POLL_PERIOD; 304 - 305 282 if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll || 306 283 dev->mode_config.poll_running) 307 284 return; 308 285 309 - poll = drm_kms_helper_enable_hpd(dev); 310 - 311 - if (dev->mode_config.delayed_event) { 312 - /* 313 - * FIXME: 314 - * 315 - * Use short (1s) delay to handle the initial delayed event. 316 - * This delay should not be needed, but Optimus/nouveau will 317 - * fail in a mysterious way if the delayed event is handled as 318 - * soon as possible like it is done in 319 - * drm_helper_probe_single_connector_modes() in case the poll 320 - * was enabled before. 321 - */ 322 - poll = true; 323 - delay = HZ; 324 - } 325 - 326 - if (poll) 327 - schedule_delayed_work(&dev->mode_config.output_poll_work, delay); 286 + if (drm_kms_helper_enable_hpd(dev) || 287 + dev->mode_config.delayed_event) 288 + reschedule_output_poll_work(dev); 328 289 329 290 dev->mode_config.poll_running = true; 330 291 } 331 292 EXPORT_SYMBOL(drm_kms_helper_poll_enable); 293 + 294 + /** 295 + * drm_kms_helper_poll_reschedule - reschedule the output polling work 296 + * @dev: drm_device 297 + * 298 + * This function reschedules the output polling work, after polling for a 299 + * connector has been enabled. 300 + * 301 + * Drivers must call this helper after enabling polling for a connector by 302 + * setting %DRM_CONNECTOR_POLL_CONNECT / %DRM_CONNECTOR_POLL_DISCONNECT flags 303 + * in drm_connector::polled. Note that after disabling polling by clearing these 304 + * flags for a connector will stop the output polling work automatically if 305 + * the polling is disabled for all other connectors as well. 306 + * 307 + * The function can be called only after polling has been enabled by calling 308 + * drm_kms_helper_poll_init() / drm_kms_helper_poll_enable(). 309 + */ 310 + void drm_kms_helper_poll_reschedule(struct drm_device *dev) 311 + { 312 + if (dev->mode_config.poll_running) 313 + reschedule_output_poll_work(dev); 314 + } 315 + EXPORT_SYMBOL(drm_kms_helper_poll_reschedule); 332 316 333 317 static enum drm_connector_status 334 318 drm_helper_probe_detect_ctx(struct drm_connector *connector, bool force)
+2 -2
drivers/gpu/drm/i915/display/intel_hotplug.c
··· 211 211 212 212 /* Enable polling and queue hotplug re-enabling. */ 213 213 if (hpd_disabled) { 214 - drm_kms_helper_poll_enable(&dev_priv->drm); 214 + drm_kms_helper_poll_reschedule(&dev_priv->drm); 215 215 mod_delayed_work(dev_priv->unordered_wq, 216 216 &dev_priv->display.hotplug.reenable_work, 217 217 msecs_to_jiffies(HPD_STORM_REENABLE_DELAY)); ··· 661 661 drm_connector_list_iter_end(&conn_iter); 662 662 663 663 if (enabled) 664 - drm_kms_helper_poll_enable(&dev_priv->drm); 664 + drm_kms_helper_poll_reschedule(&dev_priv->drm); 665 665 666 666 mutex_unlock(&dev_priv->drm.mode_config.mutex); 667 667
+1 -1
drivers/gpu/drm/i915/i915_vma.c
··· 1356 1356 */ 1357 1357 for_each_gt(gt, vm->i915, id) 1358 1358 WRITE_ONCE(tlb[id], 1359 - intel_gt_next_invalidate_tlb_full(vm->gt)); 1359 + intel_gt_next_invalidate_tlb_full(gt)); 1360 1360 } 1361 1361 1362 1362 static void __vma_put_pages(struct i915_vma *vma, unsigned int count)
+1
include/drm/drm_probe_helper.h
··· 25 25 26 26 void drm_kms_helper_poll_disable(struct drm_device *dev); 27 27 void drm_kms_helper_poll_enable(struct drm_device *dev); 28 + void drm_kms_helper_poll_reschedule(struct drm_device *dev); 28 29 bool drm_kms_helper_is_poll_worker(void); 29 30 30 31 enum drm_mode_status drm_crtc_helper_mode_valid_fixed(struct drm_crtc *crtc,