<div dir="ltr">Reviewed-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@gmail.com">rodrigo.vivi@gmail.com</a>><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 26, 2013 at 1:25 PM, Jesse Barnes <span dir="ltr"><<a href="mailto:jbarnes@virtuousgeek.org" target="_blank">jbarnes@virtuousgeek.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To be used to restore sprite state on resume.<br>
<br>
v2: move sprite tracking bits up so we don't track modified sprite state<br>
v3: use src_x/y in sprite suspend/resume code (Ville)<br>
<br>
Signed-off-by: Jesse Barnes <<a href="mailto:jbarnes@virtuousgeek.org">jbarnes@virtuousgeek.org</a>><br>
---<br>
drivers/gpu/drm/i915/intel_drv.h | 5 +++++<br>
drivers/gpu/drm/i915/intel_sprite.c | 23 +++++++++++++++++++++++<br>
2 files changed, 28 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h<br>
index 599e978..276f665 100644<br>
--- a/drivers/gpu/drm/i915/intel_drv.h<br>
+++ b/drivers/gpu/drm/i915/intel_drv.h<br>
@@ -247,6 +247,10 @@ struct intel_plane {<br>
bool can_scale;<br>
int max_downscale;<br>
u32 lut_r[1024], lut_g[1024], lut_b[1024];<br>
+ int crtc_x, crtc_y;<br>
+ unsigned int crtc_w, crtc_h;<br>
+ uint32_t src_x, src_y;<br>
+ uint32_t src_w, src_h;<br>
void (*update_plane)(struct drm_plane *plane,<br>
struct drm_framebuffer *fb,<br>
struct drm_i915_gem_object *obj,<br>
@@ -532,6 +536,7 @@ extern bool intel_encoder_check_is_cloned(struct intel_encoder *encoder);<br>
extern void intel_connector_dpms(struct drm_connector *, int mode);<br>
extern bool intel_connector_get_hw_state(struct intel_connector *connector);<br>
extern void intel_modeset_check_state(struct drm_device *dev);<br>
+extern void intel_plane_restore(struct drm_plane *plane);<br>
<br>
<br>
static inline struct intel_encoder *intel_attached_encoder(struct drm_connector *connector)<br>
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c<br>
index 1b6eb76..6fdd427 100644<br>
--- a/drivers/gpu/drm/i915/intel_sprite.c<br>
+++ b/drivers/gpu/drm/i915/intel_sprite.c<br>
@@ -441,6 +441,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,<br>
<br>
old_obj = intel_plane->obj;<br>
<br>
+ intel_plane->crtc_x = crtc_x;<br>
+ intel_plane->crtc_y = crtc_y;<br>
+ intel_plane->crtc_w = crtc_w;<br>
+ intel_plane->crtc_h = crtc_h;<br>
+ intel_plane->src_x = src_x;<br>
+ intel_plane->src_y = src_y;<br>
+ intel_plane->src_w = src_w;<br>
+ intel_plane->src_h = src_h;<br>
+<br>
src_w = src_w >> 16;<br>
src_h = src_h >> 16;<br>
<br>
@@ -647,6 +656,20 @@ out_unlock:<br>
return ret;<br>
}<br>
<br>
+void intel_plane_restore(struct drm_plane *plane)<br>
+{<br>
+ struct intel_plane *intel_plane = to_intel_plane(plane);<br>
+<br>
+ if (!plane->crtc || !plane->fb)<br>
+ return;<br>
+<br>
+ intel_update_plane(plane, plane->crtc, plane->fb,<br>
+ intel_plane->crtc_x, intel_plane->crtc_y,<br>
+ intel_plane->crtc_w, intel_plane->crtc_h,<br>
+ intel_plane->src_x, intel_plane->src_y,<br>
+ intel_plane->src_w, intel_plane->src_h);<br>
+}<br>
+<br>
static const struct drm_plane_funcs intel_plane_funcs = {<br>
.update_plane = intel_update_plane,<br>
.disable_plane = intel_disable_plane,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Rodrigo Vivi</div><div>Blog: <a href="http://blog.vivi.eng.br" target="_blank">http://blog.vivi.eng.br</a></div><div> </div>
</div>