Skip to content

Commit 67f1976

Browse files
committed
Merge tag 'drm-intel-fixes-2018-03-14' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- 1 display fix for bxt - 1 gem fix for fences - 1 gem/pm fix for rps freq * tag 'drm-intel-fixes-2018-03-14' of git://anongit.freedesktop.org/drm/drm-intel: drm/i915: Kick the rps worker when changing the boost frequency drm/i915: Only prune fences after wait-for-all drm/i915: Enable VBT based BL control for DP
2 parents 4cdc8f1 + f1430f1 commit 67f1976

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,20 +434,28 @@ i915_gem_object_wait_reservation(struct reservation_object *resv,
434434
dma_fence_put(shared[i]);
435435
kfree(shared);
436436

437+
/*
438+
* If both shared fences and an exclusive fence exist,
439+
* then by construction the shared fences must be later
440+
* than the exclusive fence. If we successfully wait for
441+
* all the shared fences, we know that the exclusive fence
442+
* must all be signaled. If all the shared fences are
443+
* signaled, we can prune the array and recover the
444+
* floating references on the fences/requests.
445+
*/
437446
prune_fences = count && timeout >= 0;
438447
} else {
439448
excl = reservation_object_get_excl_rcu(resv);
440449
}
441450

442-
if (excl && timeout >= 0) {
451+
if (excl && timeout >= 0)
443452
timeout = i915_gem_object_wait_fence(excl, flags, timeout,
444453
rps_client);
445-
prune_fences = timeout >= 0;
446-
}
447454

448455
dma_fence_put(excl);
449456

450-
/* Oportunistically prune the fences iff we know they have *all* been
457+
/*
458+
* Opportunistically prune the fences iff we know they have *all* been
451459
* signaled and that the reservation object has not been changed (i.e.
452460
* no new fences have been added).
453461
*/

drivers/gpu/drm/i915/i915_sysfs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
304304
{
305305
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
306306
struct intel_rps *rps = &dev_priv->gt_pm.rps;
307-
u32 val;
307+
bool boost = false;
308308
ssize_t ret;
309+
u32 val;
309310

310311
ret = kstrtou32(buf, 0, &val);
311312
if (ret)
@@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
317318
return -EINVAL;
318319

319320
mutex_lock(&dev_priv->pcu_lock);
320-
rps->boost_freq = val;
321+
if (val != rps->boost_freq) {
322+
rps->boost_freq = val;
323+
boost = atomic_read(&rps->num_waiters);
324+
}
321325
mutex_unlock(&dev_priv->pcu_lock);
326+
if (boost)
327+
schedule_work(&rps->work);
322328

323329
return count;
324330
}

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -620,19 +620,15 @@ static int
620620
bxt_power_sequencer_idx(struct intel_dp *intel_dp)
621621
{
622622
struct drm_i915_private *dev_priv = to_i915(intel_dp_to_dev(intel_dp));
623+
int backlight_controller = dev_priv->vbt.backlight.controller;
623624

624625
lockdep_assert_held(&dev_priv->pps_mutex);
625626

626627
/* We should never land here with regular DP ports */
627628
WARN_ON(!intel_dp_is_edp(intel_dp));
628629

629-
/*
630-
* TODO: BXT has 2 PPS instances. The correct port->PPS instance
631-
* mapping needs to be retrieved from VBT, for now just hard-code to
632-
* use instance #0 always.
633-
*/
634630
if (!intel_dp->pps_reset)
635-
return 0;
631+
return backlight_controller;
636632

637633
intel_dp->pps_reset = false;
638634

@@ -642,7 +638,7 @@ bxt_power_sequencer_idx(struct intel_dp *intel_dp)
642638
*/
643639
intel_dp_init_panel_power_sequencer_registers(intel_dp, false);
644640

645-
return 0;
641+
return backlight_controller;
646642
}
647643

648644
typedef bool (*vlv_pipe_check)(struct drm_i915_private *dev_priv,

0 commit comments

Comments
 (0)