intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH CI 1/4] drm: Add function to convert rect in 16.16 fixed format to regular format
Date: Mon,  4 Jan 2021 12:56:51 -0800	[thread overview]
Message-ID: <20210104205654.238928-1-jose.souza@intel.com> (raw)

Much more clear to read one function call than four lines doing this
conversion.

v7:
- function renamed
- calculating width and height before truncate
- inlined

v10:
- renamed parameters from source and destination to src and dst
to match sister functions

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 include/drm/drm_rect.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
index e7f4d24cdd00..39f2deee709c 100644
--- a/include/drm/drm_rect.h
+++ b/include/drm/drm_rect.h
@@ -206,6 +206,19 @@ static inline bool drm_rect_equals(const struct drm_rect *r1,
 		r1->y1 == r2->y1 && r1->y2 == r2->y2;
 }
 
+/**
+ * drm_rect_fp_to_int - Convert a rect in 16.16 fixed point form to int form.
+ * @dst: rect to be stored the converted value
+ * @src: rect in 16.16 fixed point form
+ */
+static inline void drm_rect_fp_to_int(struct drm_rect *dst,
+				      const struct drm_rect *src)
+{
+	drm_rect_init(dst, src->x1 >> 16, src->y1 >> 16,
+		      drm_rect_width(src) >> 16,
+		      drm_rect_height(src) >> 16);
+}
+
 bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip);
 bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
 			  const struct drm_rect *clip);
-- 
2.30.0

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

             reply	other threads:[~2021-01-04 20:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 20:56 José Roberto de Souza [this message]
2021-01-04 20:56 ` [Intel-gfx] [PATCH CI 2/4] drm/i915/display/psr: Use plane damage clips to calculate damaged area José Roberto de Souza
2021-07-20 15:09   ` Daniel Vetter
2021-07-20 15:16     ` Daniel Vetter
2021-07-20 15:31       ` Daniel Vetter
2021-07-20 16:55         ` Souza, Jose
2021-07-21  7:50           ` Daniel Vetter
2021-07-21  7:56             ` Daniel Vetter
2021-07-21  8:20               ` Daniel Vetter
2021-07-21 19:42               ` Souza, Jose
2021-07-22 12:19                 ` Daniel Vetter
2021-01-04 20:56 ` [Intel-gfx] [PATCH CI 3/4] drm/i915/display: Split and export main surface calculation from skl_check_main_surface() José Roberto de Souza
2021-01-04 20:56 ` [Intel-gfx] [PATCH CI 4/4] drm/i915/display/psr: Program plane's calculated offset to plane SF register José Roberto de Souza
2021-01-04 22:27 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [CI,1/4] drm: Add function to convert rect in 16.16 fixed format to regular format Patchwork
2021-01-04 22:54 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-05  1:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-05 13:29   ` Souza, Jose

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=20210104205654.238928-1-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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).