Skip to content

Commit f4e4371

Browse files
Thomas ZimmermannMaarten Lankhorst
authored andcommitted
drm/i915/display: Remove fbdev suspend and hotplug tracking
The DRM client code already tracks suspend status and hotplug events for each client. Remove similar code from i915's fbdev client. Allows for the removal of all hdp_* fields form struct intel_fbdev. Calls to intel_fbdev_output_poll_changed() are reduced the shared helper drm_fb_helper_hotplug_event(). Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent a93247b commit f4e4371

File tree

1 file changed

+2
-61
lines changed

1 file changed

+2
-61
lines changed

drivers/gpu/drm/i915/display/intel_fbdev.c

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ struct intel_fbdev {
6161
struct i915_vma *vma;
6262
unsigned long vma_flags;
6363
int preferred_bpp;
64-
65-
/* Whether or not fbdev hpd processing is temporarily suspended */
66-
bool hpd_suspended: 1;
67-
/* Set when a hotplug was received while HPD processing was suspended */
68-
bool hpd_waiting: 1;
69-
70-
/* Protects hpd_suspended */
71-
struct mutex hpd_lock;
7264
};
7365

7466
static struct intel_fbdev *to_intel_fbdev(struct drm_fb_helper *fb_helper)
@@ -187,12 +179,6 @@ static int intelfb_create(struct drm_fb_helper *helper,
187179
struct drm_gem_object *obj;
188180
int ret;
189181

190-
mutex_lock(&ifbdev->hpd_lock);
191-
ret = ifbdev->hpd_suspended ? -EAGAIN : 0;
192-
mutex_unlock(&ifbdev->hpd_lock);
193-
if (ret)
194-
return ret;
195-
196182
ifbdev->fb = NULL;
197183

198184
if (fb &&
@@ -459,27 +445,6 @@ static void intel_fbdev_suspend_worker(struct work_struct *work)
459445
true);
460446
}
461447

462-
/* Suspends/resumes fbdev processing of incoming HPD events. When resuming HPD
463-
* processing, fbdev will perform a full connector reprobe if a hotplug event
464-
* was received while HPD was suspended.
465-
*/
466-
static void intel_fbdev_hpd_set_suspend(struct drm_i915_private *i915, int state)
467-
{
468-
struct intel_fbdev *ifbdev = i915->display.fbdev.fbdev;
469-
bool send_hpd = false;
470-
471-
mutex_lock(&ifbdev->hpd_lock);
472-
ifbdev->hpd_suspended = state == FBINFO_STATE_SUSPENDED;
473-
send_hpd = !ifbdev->hpd_suspended && ifbdev->hpd_waiting;
474-
ifbdev->hpd_waiting = false;
475-
mutex_unlock(&ifbdev->hpd_lock);
476-
477-
if (send_hpd) {
478-
drm_dbg_kms(&i915->drm, "Handling delayed fbcon HPD event\n");
479-
drm_fb_helper_hotplug_event(&ifbdev->helper);
480-
}
481-
}
482-
483448
void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
484449
{
485450
struct drm_i915_private *dev_priv = to_i915(dev);
@@ -493,7 +458,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
493458
return;
494459

495460
if (!ifbdev->vma)
496-
goto set_suspend;
461+
return;
497462

498463
info = ifbdev->helper.info;
499464

@@ -536,28 +501,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
536501

537502
drm_fb_helper_set_suspend(&ifbdev->helper, state);
538503
console_unlock();
539-
540-
set_suspend:
541-
intel_fbdev_hpd_set_suspend(dev_priv, state);
542-
}
543-
544-
static int intel_fbdev_output_poll_changed(struct drm_device *dev)
545-
{
546-
struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev;
547-
bool send_hpd;
548-
549-
if (!ifbdev)
550-
return -EINVAL;
551-
552-
mutex_lock(&ifbdev->hpd_lock);
553-
send_hpd = !ifbdev->hpd_suspended;
554-
ifbdev->hpd_waiting = true;
555-
mutex_unlock(&ifbdev->hpd_lock);
556-
557-
if (send_hpd && (ifbdev->vma || ifbdev->helper.deferred_setup))
558-
drm_fb_helper_hotplug_event(&ifbdev->helper);
559-
560-
return 0;
561504
}
562505

563506
static int intel_fbdev_restore_mode(struct drm_i915_private *dev_priv)
@@ -622,7 +565,7 @@ static int intel_fbdev_client_hotplug(struct drm_client_dev *client)
622565
int ret;
623566

624567
if (dev->fb_helper)
625-
return intel_fbdev_output_poll_changed(dev);
568+
return drm_fb_helper_hotplug_event(dev->fb_helper);
626569

627570
ret = drm_fb_helper_init(dev, fb_helper);
628571
if (ret)
@@ -682,7 +625,6 @@ void intel_fbdev_setup(struct drm_i915_private *i915)
682625

683626
i915->display.fbdev.fbdev = ifbdev;
684627
INIT_WORK(&i915->display.fbdev.suspend_work, intel_fbdev_suspend_worker);
685-
mutex_init(&ifbdev->hpd_lock);
686628
if (intel_fbdev_init_bios(dev, ifbdev))
687629
ifbdev->helper.preferred_bpp = ifbdev->preferred_bpp;
688630
else
@@ -701,7 +643,6 @@ void intel_fbdev_setup(struct drm_i915_private *i915)
701643

702644
err_drm_fb_helper_unprepare:
703645
drm_fb_helper_unprepare(&ifbdev->helper);
704-
mutex_destroy(&ifbdev->hpd_lock);
705646
kfree(ifbdev);
706647
}
707648

0 commit comments

Comments
 (0)