All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v10 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format
@ 2021-01-04 11:58 Gwan-gyeong Mun
  2021-01-04 11:58 ` [Intel-gfx] [PATCH v10 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area Gwan-gyeong Mun
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Gwan-gyeong Mun @ 2021-01-04 11:58 UTC (permalink / raw)
  To: intel-gfx

From: José Roberto de Souza <jose.souza@intel.com>

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

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

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@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..7eb84af4a818 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.
+ * @destination: rect to be stored the converted value
+ * @source: rect in 16.16 fixed point form
+ */
+static inline void drm_rect_fp_to_int(struct drm_rect *destination,
+				      const struct drm_rect *source)
+{
+	drm_rect_init(destination, source->x1 >> 16, source->y1 >> 16,
+		      drm_rect_width(source) >> 16,
+		      drm_rect_height(source) >> 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.25.0

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-04 14:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 11:58 [Intel-gfx] [PATCH v10 1/5] drm: Add function to convert rect in 16.16 fixed format to regular format Gwan-gyeong Mun
2021-01-04 11:58 ` [Intel-gfx] [PATCH v10 2/5] drm/i915/display/psr: Use plane damage clips to calculate damaged area Gwan-gyeong Mun
2021-01-04 11:58 ` [Intel-gfx] [PATCH v10 3/5] drm/i915/display: Split and export main surface calculation from skl_check_main_surface() Gwan-gyeong Mun
2021-01-04 11:58 ` [Intel-gfx] [PATCH v10 4/5] drm/i915/display/psr: Program plane's calculated offset to plane SF register Gwan-gyeong Mun
2021-01-04 11:58 ` [Intel-gfx] [PATCH v10 5/5] HAX/DO_NOT_MERGE_IT: drm/i915/display: Enable PSR2 selective fetch for testing Gwan-gyeong Mun
2021-01-04 13:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v10,1/5] drm: Add function to convert rect in 16.16 fixed format to regular format Patchwork
2021-01-04 14:19 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.