intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Shobhit Kumar <shobhit.kumar@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [v2 4/6] drm/i915/skl+: Use scaling amount for plane data rate calculation
Date: Wed, 27 Jan 2016 21:40:01 +0530	[thread overview]
Message-ID: <1453911003-9856-4-git-send-email-shobhit.kumar@intel.com> (raw)
In-Reply-To: <1453911003-9856-1-git-send-email-shobhit.kumar@intel.com>

From: "Kumar, Mahesh" <mahesh1.kumar@intel.com>

if downscaling is enabled plane data rate increases according to scaling
amount. take scaling amount under consideration while calculating plane
data rate

v2: Address Matt's comments, where data rate was overridden because of
missing else.

Cc: matthew.d.roper@intel.com
Signed-off-by: Kumar, Mahesh <mahesh1.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 40fff09..a9f9396 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2912,6 +2912,8 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,
 {
 	struct intel_plane_state *intel_pstate = to_intel_plane_state(pstate);
 	struct drm_framebuffer *fb = pstate->fb;
+	struct intel_plane *intel_plane = to_intel_plane(pstate->plane);
+	uint32_t down_scale_amount, data_rate;
 	uint32_t width = 0, height = 0;
 
 	width = drm_rect_width(&intel_pstate->src) >> 16;
@@ -2923,15 +2925,20 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,
 	/* for planar format */
 	if (fb->pixel_format == DRM_FORMAT_NV12) {
 		if (y)  /* y-plane data rate */
-			return width * height *
+			data_rate = width * height *
 				drm_format_plane_cpp(fb->pixel_format, 0);
 		else    /* uv-plane data rate */
-			return (width / 2) * (height / 2) *
+			data_rate = (width / 2) * (height / 2) *
 				drm_format_plane_cpp(fb->pixel_format, 1);
-	}
+	} else
+		/* for packed formats */
+		data_rate = width * height *
+			drm_format_plane_cpp(fb->pixel_format, 0);
+
+	down_scale_amount = skl_plane_downscale_amount(intel_plane);
+
+	return DIV_ROUND_UP((data_rate * down_scale_amount), 1000);
 
-	/* for packed formats */
-	return width * height * drm_format_plane_cpp(fb->pixel_format, 0);
 }
 
 /*
-- 
2.5.0

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

  parent reply	other threads:[~2016-01-27 16:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 16:09 [v2 1/6] drm/i915/skl+: Use plane size for relative data rate calculation Shobhit Kumar
2016-01-27 16:09 ` [v2 2/6] drm/i915/skl+: calculate ddb minimum allocation Shobhit Kumar
2016-02-05 14:29   ` Matt Roper
2016-02-09  4:51     ` Kumar, Shobhit
2016-01-27 16:10 ` [v2 3/6] drm/i915/skl+: calculate plane pixel rate Shobhit Kumar
2016-02-10 18:53   ` Matt Roper
2016-01-27 16:10 ` Shobhit Kumar [this message]
2016-02-10 19:39   ` [v2 4/6] drm/i915/skl+: Use scaling amount for plane data rate calculation Matt Roper
2016-02-11  8:43     ` Daniel Vetter
2016-01-27 16:10 ` [v2 5/6] drm/i915: Add support to parse DMI table and get platform memory info Shobhit Kumar
2016-02-10 22:29   ` Matt Roper
2016-01-27 16:10 ` [v2 6/6] drm/i915/skl: WA for watermark calculation based on Arbitrated Display BW Shobhit Kumar
2016-02-02 13:47 ` [v2 1/6] drm/i915/skl+: Use plane size for relative data rate calculation Kumar, Shobhit
2016-02-05 14:29 ` Matt Roper

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=1453911003-9856-4-git-send-email-shobhit.kumar@intel.com \
    --to=shobhit.kumar@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;
as well as URLs for NNTP newsgroup(s).