public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Sonika Jindal <sonika.jindal@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/3] drm/i915: Using plane state parameters instead of pipe's
Date: Thu,  5 Mar 2015 14:51:27 +0530	[thread overview]
Message-ID: <1425547288-16131-2-git-send-email-sonika.jindal@intel.com> (raw)
In-Reply-To: <1425547288-16131-1-git-send-email-sonika.jindal@intel.com>

For primary plane, we can use the plane's state for src width and height
like sprite plane.

Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e1b0c4d..afdc101 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3001,6 +3001,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
 	int pipe = intel_crtc->pipe;
 	u32 plane_ctl, stride_div;
 	unsigned long surf_addr;
+	struct drm_plane *plane;
 
 	if (!intel_crtc->primary_enabled) {
 		I915_WRITE(PLANE_CTL(pipe, 0), 0);
@@ -3060,14 +3061,15 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
 		MISSING_CASE(fb->modifier[0]);
 	}
 
+	plane = crtc->primary;
 	plane_ctl |= PLANE_CTL_PLANE_GAMMA_DISABLE;
-	if (crtc->primary->state->rotation == BIT(DRM_ROTATE_180))
+	if (plane->state->rotation == BIT(DRM_ROTATE_180))
 		plane_ctl |= PLANE_CTL_ROTATE_180;
 
 	obj = intel_fb_obj(fb);
 	stride_div = intel_fb_stride_alignment(dev, fb->modifier[0],
 					       fb->pixel_format);
-	surf_addr = intel_plane_obj_offset(to_intel_plane(crtc->primary), obj);
+	surf_addr = intel_plane_obj_offset(to_intel_plane(plane), obj);
 
 	I915_WRITE(PLANE_CTL(pipe, 0), plane_ctl);
 
@@ -3079,8 +3081,8 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
 	I915_WRITE(PLANE_POS(pipe, 0), 0);
 	I915_WRITE(PLANE_OFFSET(pipe, 0), (y << 16) | x);
 	I915_WRITE(PLANE_SIZE(pipe, 0),
-		   (intel_crtc->config->pipe_src_h - 1) << 16 |
-		   (intel_crtc->config->pipe_src_w - 1));
+		   ((plane->state->src_h >> 16) - 1) << 16 |
+		   ((plane->state->src_w >> 16) - 1));
 	I915_WRITE(PLANE_STRIDE(pipe, 0), fb->pitches[0] / stride_div);
 	I915_WRITE(PLANE_SURF(pipe, 0), surf_addr);
 
-- 
1.7.10.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-03-05  9:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05  9:21 [PATCH 1/3] drm/i915/skl: Allow universal planes to position Sonika Jindal
2015-03-05  9:21 ` Sonika Jindal [this message]
2015-03-05 13:01   ` [PATCH 2/3] drm/i915: Using plane state parameters instead of pipe's Daniel Vetter
2015-03-05  9:21 ` [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation Sonika Jindal
2015-03-05 12:56   ` Daniel Vetter
2015-03-05 13:08     ` Ville Syrjälä
2015-03-05 15:29       ` Daniel Vetter
2015-03-05 15:56         ` Ville Syrjälä
2015-03-06 17:03           ` Daniel Vetter
2015-03-06 17:22             ` Ville Syrjälä
2015-03-06 17:38               ` Daniel Vetter
2015-03-05 12:54 ` [PATCH 1/3] drm/i915/skl: Allow universal planes to position Daniel Vetter
2015-03-09  3:03   ` sonika
2015-03-09  8:46     ` Daniel Vetter
2015-03-09 15:20       ` Ville Syrjälä
2015-03-09 15:31         ` Daniel Vetter
2015-03-10  3:53       ` sonika
2015-03-10 10:10         ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425547288-16131-2-git-send-email-sonika.jindal@intel.com \
    --to=sonika.jindal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox