Commit 5748b6a1 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Use dev_priv consistently through the intel_frontbuffer interface

Rather than a mismash of struct drm_device *dev and struct
drm_i915_private *dev_priv being used freely within a function, be
consistent and only pass along dev_priv.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470324762-2545-22-git-send-email-chris@chris-wilson.co.uk
parent faf5bf0a
...@@ -4566,12 +4566,11 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) ...@@ -4566,12 +4566,11 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
struct drm_atomic_state *old_state = old_crtc_state->base.state; struct drm_atomic_state *old_state = old_crtc_state->base.state;
struct intel_crtc_state *pipe_config = struct intel_crtc_state *pipe_config =
to_intel_crtc_state(crtc->base.state); to_intel_crtc_state(crtc->base.state);
struct drm_device *dev = crtc->base.dev;
struct drm_plane *primary = crtc->base.primary; struct drm_plane *primary = crtc->base.primary;
struct drm_plane_state *old_pri_state = struct drm_plane_state *old_pri_state =
drm_atomic_get_existing_plane_state(old_state, primary); drm_atomic_get_existing_plane_state(old_state, primary);
intel_frontbuffer_flip(dev, pipe_config->fb_bits); intel_frontbuffer_flip(to_i915(crtc->base.dev), pipe_config->fb_bits);
crtc->wm.cxsr_allowed = true; crtc->wm.cxsr_allowed = true;
...@@ -4694,7 +4693,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_mask ...@@ -4694,7 +4693,7 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc, unsigned plane_mask
* to compute the mask of flip planes precisely. For the time being * to compute the mask of flip planes precisely. For the time being
* consider this a flip to a NULL plane. * consider this a flip to a NULL plane.
*/ */
intel_frontbuffer_flip(dev, INTEL_FRONTBUFFER_ALL_MASK(pipe)); intel_frontbuffer_flip(to_i915(dev), INTEL_FRONTBUFFER_ALL_MASK(pipe));
} }
static void ironlake_crtc_enable(struct drm_crtc *crtc) static void ironlake_crtc_enable(struct drm_crtc *crtc)
...@@ -10952,7 +10951,8 @@ static void intel_unpin_work_fn(struct work_struct *__work) ...@@ -10952,7 +10951,8 @@ static void intel_unpin_work_fn(struct work_struct *__work)
i915_gem_request_put(work->flip_queued_req); i915_gem_request_put(work->flip_queued_req);
intel_frontbuffer_flip_complete(dev, to_intel_plane(primary)->frontbuffer_bit); intel_frontbuffer_flip_complete(to_i915(dev),
to_intel_plane(primary)->frontbuffer_bit);
intel_fbc_post_update(crtc); intel_fbc_post_update(crtc);
drm_framebuffer_unreference(work->old_fb); drm_framebuffer_unreference(work->old_fb);
...@@ -11727,7 +11727,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -11727,7 +11727,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
to_intel_plane(primary)->frontbuffer_bit); to_intel_plane(primary)->frontbuffer_bit);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
intel_frontbuffer_flip_prepare(dev, intel_frontbuffer_flip_prepare(to_i915(dev),
to_intel_plane(primary)->frontbuffer_bit); to_intel_plane(primary)->frontbuffer_bit);
trace_i915_flip_request(intel_crtc->plane, obj); trace_i915_flip_request(intel_crtc->plane, obj);
......
...@@ -5228,7 +5228,7 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work) ...@@ -5228,7 +5228,7 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work)
/** /**
* intel_edp_drrs_invalidate - Disable Idleness DRRS * intel_edp_drrs_invalidate - Disable Idleness DRRS
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* This function gets called everytime rendering on the given planes start. * This function gets called everytime rendering on the given planes start.
...@@ -5236,10 +5236,9 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work) ...@@ -5236,10 +5236,9 @@ static void intel_edp_drrs_downclock_work(struct work_struct *work)
* *
* Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits. * Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits.
*/ */
void intel_edp_drrs_invalidate(struct drm_device *dev, void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned int frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
...@@ -5271,7 +5270,7 @@ void intel_edp_drrs_invalidate(struct drm_device *dev, ...@@ -5271,7 +5270,7 @@ void intel_edp_drrs_invalidate(struct drm_device *dev,
/** /**
* intel_edp_drrs_flush - Restart Idleness DRRS * intel_edp_drrs_flush - Restart Idleness DRRS
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* This function gets called every time rendering on the given planes has * This function gets called every time rendering on the given planes has
...@@ -5281,10 +5280,9 @@ void intel_edp_drrs_invalidate(struct drm_device *dev, ...@@ -5281,10 +5280,9 @@ void intel_edp_drrs_invalidate(struct drm_device *dev,
* *
* Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits. * Dirty frontbuffers relevant to DRRS are tracked in busy_frontbuffer_bits.
*/ */
void intel_edp_drrs_flush(struct drm_device *dev, void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned int frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
......
...@@ -1374,11 +1374,12 @@ uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes); ...@@ -1374,11 +1374,12 @@ uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes);
void intel_plane_destroy(struct drm_plane *plane); void intel_plane_destroy(struct drm_plane *plane);
void intel_edp_drrs_enable(struct intel_dp *intel_dp); void intel_edp_drrs_enable(struct intel_dp *intel_dp);
void intel_edp_drrs_disable(struct intel_dp *intel_dp); void intel_edp_drrs_disable(struct intel_dp *intel_dp);
void intel_edp_drrs_invalidate(struct drm_device *dev, void intel_edp_drrs_invalidate(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned int frontbuffer_bits);
void intel_edp_drrs_flush(struct drm_device *dev, unsigned frontbuffer_bits); void intel_edp_drrs_flush(struct drm_i915_private *dev_priv,
unsigned int frontbuffer_bits);
bool intel_digital_port_connected(struct drm_i915_private *dev_priv, bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
struct intel_digital_port *port); struct intel_digital_port *port);
void void
intel_dp_program_link_training_pattern(struct intel_dp *intel_dp, intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
...@@ -1551,13 +1552,13 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con ...@@ -1551,13 +1552,13 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con
/* intel_psr.c */ /* intel_psr.c */
void intel_psr_enable(struct intel_dp *intel_dp); void intel_psr_enable(struct intel_dp *intel_dp);
void intel_psr_disable(struct intel_dp *intel_dp); void intel_psr_disable(struct intel_dp *intel_dp);
void intel_psr_invalidate(struct drm_device *dev, void intel_psr_invalidate(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
void intel_psr_flush(struct drm_device *dev, void intel_psr_flush(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits, unsigned frontbuffer_bits,
enum fb_op_origin origin); enum fb_op_origin origin);
void intel_psr_init(struct drm_device *dev); void intel_psr_init(struct drm_device *dev);
void intel_psr_single_frame_update(struct drm_device *dev, void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
/* intel_runtime_pm.c */ /* intel_runtime_pm.c */
......
...@@ -70,8 +70,7 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, ...@@ -70,8 +70,7 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
enum fb_op_origin origin, enum fb_op_origin origin,
unsigned int frontbuffer_bits) unsigned int frontbuffer_bits)
{ {
struct drm_device *dev = obj->base.dev; struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
struct drm_i915_private *dev_priv = to_i915(dev);
if (origin == ORIGIN_CS) { if (origin == ORIGIN_CS) {
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
...@@ -80,14 +79,14 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, ...@@ -80,14 +79,14 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
spin_unlock(&dev_priv->fb_tracking.lock); spin_unlock(&dev_priv->fb_tracking.lock);
} }
intel_psr_invalidate(dev, frontbuffer_bits); intel_psr_invalidate(dev_priv, frontbuffer_bits);
intel_edp_drrs_invalidate(dev, frontbuffer_bits); intel_edp_drrs_invalidate(dev_priv, frontbuffer_bits);
intel_fbc_invalidate(dev_priv, frontbuffer_bits, origin); intel_fbc_invalidate(dev_priv, frontbuffer_bits, origin);
} }
/** /**
* intel_frontbuffer_flush - flush frontbuffer * intel_frontbuffer_flush - flush frontbuffer
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* @origin: which operation caused the flush * @origin: which operation caused the flush
* *
...@@ -97,12 +96,10 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, ...@@ -97,12 +96,10 @@ void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
* *
* Can be called without any locks held. * Can be called without any locks held.
*/ */
static void intel_frontbuffer_flush(struct drm_device *dev, static void intel_frontbuffer_flush(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits, unsigned frontbuffer_bits,
enum fb_op_origin origin) enum fb_op_origin origin)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
/* Delay flushing when rings are still busy.*/ /* Delay flushing when rings are still busy.*/
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
frontbuffer_bits &= ~dev_priv->fb_tracking.busy_bits; frontbuffer_bits &= ~dev_priv->fb_tracking.busy_bits;
...@@ -111,8 +108,8 @@ static void intel_frontbuffer_flush(struct drm_device *dev, ...@@ -111,8 +108,8 @@ static void intel_frontbuffer_flush(struct drm_device *dev,
if (!frontbuffer_bits) if (!frontbuffer_bits)
return; return;
intel_edp_drrs_flush(dev, frontbuffer_bits); intel_edp_drrs_flush(dev_priv, frontbuffer_bits);
intel_psr_flush(dev, frontbuffer_bits, origin); intel_psr_flush(dev_priv, frontbuffer_bits, origin);
intel_fbc_flush(dev_priv, frontbuffer_bits, origin); intel_fbc_flush(dev_priv, frontbuffer_bits, origin);
} }
...@@ -121,8 +118,7 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj, ...@@ -121,8 +118,7 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj,
enum fb_op_origin origin, enum fb_op_origin origin,
unsigned int frontbuffer_bits) unsigned int frontbuffer_bits)
{ {
struct drm_device *dev = obj->base.dev; struct drm_i915_private *dev_priv = to_i915(obj->base.dev);
struct drm_i915_private *dev_priv = to_i915(dev);
if (retire) { if (retire) {
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
...@@ -133,12 +129,12 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj, ...@@ -133,12 +129,12 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj,
} }
if (frontbuffer_bits) if (frontbuffer_bits)
intel_frontbuffer_flush(dev, frontbuffer_bits, origin); intel_frontbuffer_flush(dev_priv, frontbuffer_bits, origin);
} }
/** /**
* intel_frontbuffer_flip_prepare - prepare asynchronous frontbuffer flip * intel_frontbuffer_flip_prepare - prepare asynchronous frontbuffer flip
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* This function gets called after scheduling a flip on @obj. The actual * This function gets called after scheduling a flip on @obj. The actual
...@@ -148,23 +144,21 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj, ...@@ -148,23 +144,21 @@ void __intel_fb_obj_flush(struct drm_i915_gem_object *obj,
* *
* Can be called without any locks held. * Can be called without any locks held.
*/ */
void intel_frontbuffer_flip_prepare(struct drm_device *dev, void intel_frontbuffer_flip_prepare(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
dev_priv->fb_tracking.flip_bits |= frontbuffer_bits; dev_priv->fb_tracking.flip_bits |= frontbuffer_bits;
/* Remove stale busy bits due to the old buffer. */ /* Remove stale busy bits due to the old buffer. */
dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits; dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;
spin_unlock(&dev_priv->fb_tracking.lock); spin_unlock(&dev_priv->fb_tracking.lock);
intel_psr_single_frame_update(dev, frontbuffer_bits); intel_psr_single_frame_update(dev_priv, frontbuffer_bits);
} }
/** /**
* intel_frontbuffer_flip_complete - complete asynchronous frontbuffer flip * intel_frontbuffer_flip_complete - complete asynchronous frontbuffer flip
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* This function gets called after the flip has been latched and will complete * This function gets called after the flip has been latched and will complete
...@@ -172,11 +166,9 @@ void intel_frontbuffer_flip_prepare(struct drm_device *dev, ...@@ -172,11 +166,9 @@ void intel_frontbuffer_flip_prepare(struct drm_device *dev,
* *
* Can be called without any locks held. * Can be called without any locks held.
*/ */
void intel_frontbuffer_flip_complete(struct drm_device *dev, void intel_frontbuffer_flip_complete(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
/* Mask any cancelled flips. */ /* Mask any cancelled flips. */
frontbuffer_bits &= dev_priv->fb_tracking.flip_bits; frontbuffer_bits &= dev_priv->fb_tracking.flip_bits;
...@@ -184,12 +176,13 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev, ...@@ -184,12 +176,13 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev,
spin_unlock(&dev_priv->fb_tracking.lock); spin_unlock(&dev_priv->fb_tracking.lock);
if (frontbuffer_bits) if (frontbuffer_bits)
intel_frontbuffer_flush(dev, frontbuffer_bits, ORIGIN_FLIP); intel_frontbuffer_flush(dev_priv,
frontbuffer_bits, ORIGIN_FLIP);
} }
/** /**
* intel_frontbuffer_flip - synchronous frontbuffer flip * intel_frontbuffer_flip - synchronous frontbuffer flip
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* This function gets called after scheduling a flip on @obj. This is for * This function gets called after scheduling a flip on @obj. This is for
...@@ -198,15 +191,13 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev, ...@@ -198,15 +191,13 @@ void intel_frontbuffer_flip_complete(struct drm_device *dev,
* *
* Can be called without any locks held. * Can be called without any locks held.
*/ */
void intel_frontbuffer_flip(struct drm_device *dev, void intel_frontbuffer_flip(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
spin_lock(&dev_priv->fb_tracking.lock); spin_lock(&dev_priv->fb_tracking.lock);
/* Remove stale busy bits due to the old buffer. */ /* Remove stale busy bits due to the old buffer. */
dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits; dev_priv->fb_tracking.busy_bits &= ~frontbuffer_bits;
spin_unlock(&dev_priv->fb_tracking.lock); spin_unlock(&dev_priv->fb_tracking.lock);
intel_frontbuffer_flush(dev, frontbuffer_bits, ORIGIN_FLIP); intel_frontbuffer_flush(dev_priv, frontbuffer_bits, ORIGIN_FLIP);
} }
...@@ -24,15 +24,14 @@ ...@@ -24,15 +24,14 @@
#ifndef __INTEL_FRONTBUFFER_H__ #ifndef __INTEL_FRONTBUFFER_H__
#define __INTEL_FRONTBUFFER_H__ #define __INTEL_FRONTBUFFER_H__
struct drm_device;
struct drm_i915_private; struct drm_i915_private;
struct drm_i915_gem_object; struct drm_i915_gem_object;
void intel_frontbuffer_flip_prepare(struct drm_device *dev, void intel_frontbuffer_flip_prepare(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
void intel_frontbuffer_flip_complete(struct drm_device *dev, void intel_frontbuffer_flip_complete(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
void intel_frontbuffer_flip(struct drm_device *dev, void intel_frontbuffer_flip(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits); unsigned frontbuffer_bits);
void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj, void __intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
......
...@@ -840,8 +840,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay, ...@@ -840,8 +840,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
overlay->old_vid_bo = overlay->vid_bo; overlay->old_vid_bo = overlay->vid_bo;
overlay->vid_bo = new_bo; overlay->vid_bo = new_bo;
intel_frontbuffer_flip(&dev_priv->drm, intel_frontbuffer_flip(dev_priv, INTEL_FRONTBUFFER_OVERLAY(pipe));
INTEL_FRONTBUFFER_OVERLAY(pipe));
return 0; return 0;
......
...@@ -628,9 +628,8 @@ static void intel_psr_work(struct work_struct *work) ...@@ -628,9 +628,8 @@ static void intel_psr_work(struct work_struct *work)
mutex_unlock(&dev_priv->psr.lock); mutex_unlock(&dev_priv->psr.lock);
} }
static void intel_psr_exit(struct drm_device *dev) static void intel_psr_exit(struct drm_i915_private *dev_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_dp *intel_dp = dev_priv->psr.enabled; struct intel_dp *intel_dp = dev_priv->psr.enabled;
struct drm_crtc *crtc = dp_to_dig_port(intel_dp)->base.base.crtc; struct drm_crtc *crtc = dp_to_dig_port(intel_dp)->base.base.crtc;
enum pipe pipe = to_intel_crtc(crtc)->pipe; enum pipe pipe = to_intel_crtc(crtc)->pipe;
...@@ -639,7 +638,7 @@ static void intel_psr_exit(struct drm_device *dev) ...@@ -639,7 +638,7 @@ static void intel_psr_exit(struct drm_device *dev)
if (!dev_priv->psr.active) if (!dev_priv->psr.active)
return; return;
if (HAS_DDI(dev)) { if (HAS_DDI(dev_priv)) {
val = I915_READ(EDP_PSR_CTL); val = I915_READ(EDP_PSR_CTL);
WARN_ON(!(val & EDP_PSR_ENABLE)); WARN_ON(!(val & EDP_PSR_ENABLE));
...@@ -674,7 +673,7 @@ static void intel_psr_exit(struct drm_device *dev) ...@@ -674,7 +673,7 @@ static void intel_psr_exit(struct drm_device *dev)
/** /**
* intel_psr_single_frame_update - Single Frame Update * intel_psr_single_frame_update - Single Frame Update
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* Some platforms support a single frame update feature that is used to * Some platforms support a single frame update feature that is used to
...@@ -682,10 +681,9 @@ static void intel_psr_exit(struct drm_device *dev) ...@@ -682,10 +681,9 @@ static void intel_psr_exit(struct drm_device *dev)
* So far it is only implemented for Valleyview and Cherryview because * So far it is only implemented for Valleyview and Cherryview because
* hardware requires this to be done before a page flip. * hardware requires this to be done before a page flip.
*/ */
void intel_psr_single_frame_update(struct drm_device *dev, void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
u32 val; u32 val;
...@@ -694,7 +692,7 @@ void intel_psr_single_frame_update(struct drm_device *dev, ...@@ -694,7 +692,7 @@ void intel_psr_single_frame_update(struct drm_device *dev,
* Single frame update is already supported on BDW+ but it requires * Single frame update is already supported on BDW+ but it requires
* many W/A and it isn't really needed. * many W/A and it isn't really needed.
*/ */
if (!IS_VALLEYVIEW(dev) && !IS_CHERRYVIEW(dev)) if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv))
return; return;
mutex_lock(&dev_priv->psr.lock); mutex_lock(&dev_priv->psr.lock);
...@@ -720,7 +718,7 @@ void intel_psr_single_frame_update(struct drm_device *dev, ...@@ -720,7 +718,7 @@ void intel_psr_single_frame_update(struct drm_device *dev,
/** /**
* intel_psr_invalidate - Invalidade PSR * intel_psr_invalidate - Invalidade PSR
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* *
* Since the hardware frontbuffer tracking has gaps we need to integrate * Since the hardware frontbuffer tracking has gaps we need to integrate
...@@ -730,10 +728,9 @@ void intel_psr_single_frame_update(struct drm_device *dev, ...@@ -730,10 +728,9 @@ void intel_psr_single_frame_update(struct drm_device *dev,
* *
* Dirty frontbuffers relevant to PSR are tracked in busy_frontbuffer_bits." * Dirty frontbuffers relevant to PSR are tracked in busy_frontbuffer_bits."
*/ */
void intel_psr_invalidate(struct drm_device *dev, void intel_psr_invalidate(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits) unsigned frontbuffer_bits)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
...@@ -750,14 +747,14 @@ void intel_psr_invalidate(struct drm_device *dev, ...@@ -750,14 +747,14 @@ void intel_psr_invalidate(struct drm_device *dev,
dev_priv->psr.busy_frontbuffer_bits |= frontbuffer_bits; dev_priv->psr.busy_frontbuffer_bits |= frontbuffer_bits;
if (frontbuffer_bits) if (frontbuffer_bits)
intel_psr_exit(dev); intel_psr_exit(dev_priv);
mutex_unlock(&dev_priv->psr.lock); mutex_unlock(&dev_priv->psr.lock);
} }
/** /**
* intel_psr_flush - Flush PSR * intel_psr_flush - Flush PSR
* @dev: DRM device * @dev_priv: i915 device
* @frontbuffer_bits: frontbuffer plane tracking bits * @frontbuffer_bits: frontbuffer plane tracking bits
* @origin: which operation caused the flush * @origin: which operation caused the flush
* *
...@@ -768,10 +765,9 @@ void intel_psr_invalidate(struct drm_device *dev, ...@@ -768,10 +765,9 @@ void intel_psr_invalidate(struct drm_device *dev,
* *
* Dirty frontbuffers relevant to PSR are tracked in busy_frontbuffer_bits. * Dirty frontbuffers relevant to PSR are tracked in busy_frontbuffer_bits.
*/ */
void intel_psr_flush(struct drm_device *dev, void intel_psr_flush(struct drm_i915_private *dev_priv,
unsigned frontbuffer_bits, enum fb_op_origin origin) unsigned frontbuffer_bits, enum fb_op_origin origin)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
...@@ -789,7 +785,7 @@ void intel_psr_flush(struct drm_device *dev, ...@@ -789,7 +785,7 @@ void intel_psr_flush(struct drm_device *dev,
/* By definition flush = invalidate + flush */ /* By definition flush = invalidate + flush */
if (frontbuffer_bits) if (frontbuffer_bits)
intel_psr_exit(dev); intel_psr_exit(dev_priv);
if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits) if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits)
if (!work_busy(&dev_priv->psr.work.work)) if (!work_busy(&dev_priv->psr.work.work))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment