From: Mahesh Kumar <mahesh1.kumar@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/4] drm/i915/skl+: Use scaling amount for plane data rate calculation (v4)
Date: Mon, 30 May 2016 11:03:21 +0530 [thread overview]
Message-ID: <574BD0A1.2080209@intel.com> (raw)
In-Reply-To: <1463695381-21368-1-git-send-email-matthew.d.roper@intel.com>
Reviewed-by: Kumar Mahesh <mahesh1.kumar@intel.com>
On Friday 20 May 2016 03:33 AM, Matt Roper wrote:
> 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.
>
> v3 (by Matt):
> - Add braces to 'else' branch to match kernel coding style
> - Adjust final calculation now that skl_plane_downscale_amount()
> returns 16.16 fixed point value instead of a decimal fixed point
>
> v4 (by Matt):
> - Avoid integer overflow by making sure final multiplication is
> treated as 64-bit.
>
> Cc: matthew.d.roper@intel.com
> Signed-off-by: Kumar, Mahesh <mahesh1.kumar@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
> drivers/gpu/drm/i915/intel_pm.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 5bd885b..7a486e4 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2993,6 +2993,7 @@ 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;
> + uint32_t down_scale_amount, data_rate;
> uint32_t width = 0, height = 0;
> unsigned format = fb ? fb->pixel_format : DRM_FORMAT_XRGB8888;
>
> @@ -3012,15 +3013,19 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate,
> /* for planar format */
> if (format == DRM_FORMAT_NV12) {
> if (y) /* y-plane data rate */
> - return width * height *
> + data_rate = width * height *
> drm_format_plane_cpp(format, 0);
> else /* uv-plane data rate */
> - return (width / 2) * (height / 2) *
> + data_rate = (width / 2) * (height / 2) *
> drm_format_plane_cpp(format, 1);
> + } else {
> + /* for packed formats */
> + data_rate = width * height * drm_format_plane_cpp(format, 0);
> }
>
> - /* for packed formats */
> - return width * height * drm_format_plane_cpp(format, 0);
> + down_scale_amount = skl_plane_downscale_amount(intel_pstate);
> +
> + return (uint64_t)data_rate * down_scale_amount >> 16;
> }
>
> /*
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-05-30 5:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-16 22:51 [PATCH 0/4] SKL watermark algorithm updates Matt Roper
2016-05-16 22:51 ` [PATCH 1/4] drm/i915: Don't try to calculate relative data rates during hw readout Matt Roper
2016-05-16 22:51 ` [PATCH 2/4] drm/i915/skl+: calculate ddb minimum allocation (v4) Matt Roper
2016-05-26 22:13 ` [PATCH 2/4] drm/i915/skl+: calculate ddb minimum allocation (v5) Matt Roper
2016-05-30 5:05 ` Mahesh Kumar
2016-05-31 16:58 ` [PATCH 2/4] drm/i915/skl+: calculate ddb minimum allocation (v6) Matt Roper
2016-06-01 14:25 ` Mahesh Kumar
2016-06-01 14:40 ` Matt Roper
2016-05-16 22:52 ` [PATCH 3/4] drm/i915/skl+: calculate plane pixel rate (v4) Matt Roper
2016-05-30 5:28 ` Mahesh Kumar
2016-05-16 22:52 ` [PATCH 4/4] drm/i915/skl+: Use scaling amount for plane data rate calculation (v3) Matt Roper
2016-05-19 22:03 ` [PATCH 4/4] drm/i915/skl+: Use scaling amount for plane data rate calculation (v4) Matt Roper
2016-05-30 5:33 ` Mahesh Kumar [this message]
2016-05-17 5:51 ` ✗ Ro.CI.BAT: warning for SKL watermark algorithm updates Patchwork
2016-05-20 8:52 ` ✗ Ro.CI.BAT: warning for SKL watermark algorithm updates (rev2) Patchwork
2016-05-27 6:09 ` ✗ Ro.CI.BAT: warning for SKL watermark algorithm updates (rev3) Patchwork
2016-05-31 17:34 ` ✗ Ro.CI.BAT: warning for SKL watermark algorithm updates (rev4) Patchwork
2016-05-31 18:20 ` 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=574BD0A1.2080209@intel.com \
--to=mahesh1.kumar@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.d.roper@intel.com \
/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