From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 2/6] drm/i915: add sprite restore function v2 Date: Mon, 18 Feb 2013 19:19:55 +0200 Message-ID: <20130218171955.GQ9135@intel.com> References: <1360963394-8663-1-git-send-email-jbarnes@virtuousgeek.org> <1360963394-8663-3-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 6282EE63D9 for ; Mon, 18 Feb 2013 09:19:59 -0800 (PST) Content-Disposition: inline In-Reply-To: <1360963394-8663-3-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Feb 15, 2013 at 01:23:10PM -0800, Jesse Barnes wrote: > To be used to restore sprite state on resume. > = > v2: move sprite tracking bits up so we don't track modified sprite state > = > Signed-off-by: Jesse Barnes > --- > drivers/gpu/drm/i915/intel_drv.h | 5 +++++ > drivers/gpu/drm/i915/intel_sprite.c | 23 +++++++++++++++++++++++ > 2 files changed, 28 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/inte= l_drv.h > index 005a91f..1b548e0 100644 > --- a/drivers/gpu/drm/i915/intel_drv.h > +++ b/drivers/gpu/drm/i915/intel_drv.h > @@ -247,6 +247,10 @@ struct intel_plane { > bool can_scale; > int max_downscale; > u32 lut_r[1024], lut_g[1024], lut_b[1024]; > + int crtc_x, crtc_y; > + unsigned int crtc_w, crtc_h; > + uint32_t x, y; Can we call just them src_x/src_y instead? > + uint32_t src_w, src_h; > void (*update_plane)(struct drm_plane *plane, > struct drm_framebuffer *fb, > struct drm_i915_gem_object *obj, > @@ -532,6 +536,7 @@ extern bool intel_encoder_check_is_cloned(struct inte= l_encoder *encoder); > extern void intel_connector_dpms(struct drm_connector *, int mode); > extern bool intel_connector_get_hw_state(struct intel_connector *connect= or); > extern void intel_modeset_check_state(struct drm_device *dev); > +extern void intel_plane_restore(struct drm_plane *plane); > = > = > static inline struct intel_encoder *intel_attached_encoder(struct drm_co= nnector *connector) > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/i= ntel_sprite.c > index 03cfd62..ca171af 100644 > --- a/drivers/gpu/drm/i915/intel_sprite.c > +++ b/drivers/gpu/drm/i915/intel_sprite.c > @@ -438,6 +438,15 @@ intel_update_plane(struct drm_plane *plane, struct d= rm_crtc *crtc, > = > old_obj =3D intel_plane->obj; > = > + intel_plane->crtc_x =3D crtc_x; > + intel_plane->crtc_y =3D crtc_y; > + intel_plane->crtc_w =3D crtc_w; > + intel_plane->crtc_h =3D crtc_h; > + intel_plane->x =3D x; > + intel_plane->y =3D y; x and y are not fixed point numbers. They just contain the integer parts of src_x and src_y. So you need to use src_x and src_y here instead. > + intel_plane->src_w =3D src_w; > + intel_plane->src_h =3D src_h; > + > src_w =3D src_w >> 16; > src_h =3D src_h >> 16; > = > @@ -644,6 +653,20 @@ out_unlock: > return ret; > } > = > +void intel_plane_restore(struct drm_plane *plane) > +{ > + struct intel_plane *intel_plane =3D to_intel_plane(plane); > + > + if (!plane->crtc || !plane->fb) > + return; > + > + intel_update_plane(plane, plane->crtc, plane->fb, > + intel_plane->crtc_x, intel_plane->crtc_y, > + intel_plane->crtc_w, intel_plane->crtc_h, > + intel_plane->x, intel_plane->y, > + intel_plane->src_w, intel_plane->src_h); > +} > + > static const struct drm_plane_funcs intel_plane_funcs =3D { > .update_plane =3D intel_update_plane, > .disable_plane =3D intel_disable_plane, > -- = > 1.7.9.5 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Ville Syrj=E4l=E4 Intel OTC