Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 02/14] lib/igt_draw: Extend the API to support 64bpp colors
Date: Fri,  4 Oct 2024 13:41:09 +0300	[thread overview]
Message-ID: <20241004104121.32750-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20241004104121.32750-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pass the color as uint64_t to igt_draw in preparation
for supporting 64bpp pixel formats.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_draw.c | 28 ++++++++++++++--------------
 lib/igt_draw.h |  6 +++---
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 3ebfaad6ef31..917cc37a2175 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -363,7 +363,7 @@ static void tile4_pos_to_x_y_linear(int tiled_pos, uint32_t stride,
 	*y = tile_origin_y + subtile_origin_y + oword_num;
 }
 
-static void set_pixel(void *_ptr, int index, uint32_t color, int bpp)
+static void set_pixel(void *_ptr, int index, uint64_t color, int bpp)
 {
 	if (bpp == 16) {
 		uint16_t *ptr = _ptr;
@@ -403,7 +403,7 @@ static void switch_blt_tiling(struct intel_bb *ibb, uint32_t tiling, bool on)
 }
 
 static void draw_rect_ptr_linear(void *ptr, uint32_t stride,
-				 struct rect *rect, uint32_t color, int bpp)
+				 struct rect *rect, uint64_t color, int bpp)
 {
 	int x, y, line_begin;
 
@@ -415,7 +415,7 @@ static void draw_rect_ptr_linear(void *ptr, uint32_t stride,
 }
 
 static void draw_rect_ptr_tiled(void *ptr, uint32_t stride, uint32_t tiling,
-				int swizzle, struct rect *rect, uint32_t color,
+				int swizzle, struct rect *rect, uint64_t color,
 				int bpp)
 {
 	int x, y, pos;
@@ -444,7 +444,7 @@ static void draw_rect_ptr_tiled(void *ptr, uint32_t stride, uint32_t tiling,
 }
 
 static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
-			       uint32_t tiling, uint32_t swizzle, uint32_t color)
+			       uint32_t tiling, uint32_t swizzle, uint64_t color)
 {
 	void *ptr;
 
@@ -479,7 +479,7 @@ static void draw_rect_mmap_cpu(int fd, struct buf_data *buf, struct rect *rect,
 }
 
 static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
-			       uint32_t color)
+			       uint64_t color)
 {
 	void *ptr;
 
@@ -495,7 +495,7 @@ static void draw_rect_mmap_gtt(int fd, struct buf_data *buf, struct rect *rect,
 }
 
 static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
-			      uint32_t tiling, uint32_t swizzle, uint32_t color)
+			      uint32_t tiling, uint32_t swizzle, uint64_t color)
 {
 	void *ptr;
 
@@ -542,7 +542,7 @@ static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
 }
 
 static void draw_rect_pwrite_untiled(int fd, struct buf_data *buf,
-				     struct rect *rect, uint32_t color)
+				     struct rect *rect, uint64_t color)
 {
 	int i, y, offset;
 	int pixel_size = buf->bpp / 8;
@@ -559,7 +559,7 @@ static void draw_rect_pwrite_untiled(int fd, struct buf_data *buf,
 
 static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
 				   uint32_t tiling, struct rect *rect,
-				   uint32_t color, uint32_t swizzle)
+				   uint64_t color, uint32_t swizzle)
 {
 	int i;
 	int tiled_pos, x, y, pixel_size;
@@ -624,7 +624,7 @@ static void draw_rect_pwrite_tiled(int fd, struct buf_data *buf,
 
 static void draw_rect_pwrite(int fd, struct buf_data *buf,
 			     struct rect *rect, uint32_t tiling,
-			     uint32_t swizzle, uint32_t color)
+			     uint32_t swizzle, uint64_t color)
 {
 	switch (tiling) {
 	case I915_TILING_NONE:
@@ -674,7 +674,7 @@ static struct intel_buf *create_buf(int fd, struct buf_ops *bops,
 
 static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 			  struct buf_data *buf, struct rect *rect,
-			  uint32_t tiling, uint32_t color)
+			  uint32_t tiling, uint64_t color)
 {
 	struct intel_bb *ibb;
 	struct intel_buf *dst;
@@ -785,7 +785,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 
 static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 			     struct buf_data *buf, struct rect *rect,
-			     uint32_t tiling, uint32_t color)
+			     uint32_t tiling, uint64_t color)
 {
 	struct intel_buf *src, *dst;
 	uint32_t devid = intel_get_drm_devid(fd);
@@ -858,7 +858,7 @@ void igt_draw_rect(int fd, struct buf_ops *bops, uint32_t ctx,
 		   int buf_width, int buf_height,
 		   uint32_t tiling, enum igt_draw_method method,
 		   int rect_x, int rect_y, int rect_w, int rect_h,
-		   uint32_t color, int bpp)
+		   uint64_t color, int bpp)
 {
 	uint32_t buf_tiling, swizzle;
 
@@ -932,7 +932,7 @@ void igt_draw_rect(int fd, struct buf_ops *bops, uint32_t ctx,
 void igt_draw_rect_fb(int fd, struct buf_ops *bops,
 		      uint32_t ctx, struct igt_fb *fb,
 		      enum igt_draw_method method, int rect_x, int rect_y,
-		      int rect_w, int rect_h, uint32_t color)
+		      int rect_w, int rect_h, uint64_t color)
 {
 	igt_draw_rect(fd, bops, ctx, fb->gem_handle, fb->size, fb->strides[0],
 		      fb->width, fb->height,
@@ -949,7 +949,7 @@ void igt_draw_rect_fb(int fd, struct buf_ops *bops,
  *
  * This function just paints an igt_fb using the provided color.
  */
-void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint32_t color)
+void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint64_t color)
 {
 	igt_draw_rect_fb(fd, NULL, 0, fb,
 			 igt_draw_supports_method(fd, IGT_DRAW_MMAP_GTT) ?
diff --git a/lib/igt_draw.h b/lib/igt_draw.h
index 1dec95e86e0f..33763812ea4f 100644
--- a/lib/igt_draw.h
+++ b/lib/igt_draw.h
@@ -57,13 +57,13 @@ void igt_draw_rect(int fd, struct buf_ops *bops, uint32_t ctx,
 		   int buf_width, int buf_height,
 		   uint32_t tiling, enum igt_draw_method method,
 		   int rect_x, int rect_y, int rect_w, int rect_h,
-		   uint32_t color, int bpp);
+		   uint64_t color, int bpp);
 
 void igt_draw_rect_fb(int fd, struct buf_ops *bops,
 		      uint32_t ctx, struct igt_fb *fb,
 		      enum igt_draw_method method, int rect_x, int rect_y,
-		      int rect_w, int rect_h, uint32_t color);
+		      int rect_w, int rect_h, uint64_t color);
 
-void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint32_t color);
+void igt_draw_fill_fb(int fd, struct igt_fb *fb, uint64_t color);
 
 #endif /* __IGT_DRAW_H__ */
-- 
2.45.2


  parent reply	other threads:[~2024-10-04 10:41 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 10:41 [PATCH i-g-t 00/14] intel: igt_draw and intel_bufops improvements Ville Syrjala
2024-10-04 10:41 ` [PATCH i-g-t 01/14] lib/igt_draw: Use void* where appopriate Ville Syrjala
2024-10-29 14:44   ` Juha-Pekka Heikkila
2024-10-04 10:41 ` Ville Syrjala [this message]
2024-10-22 16:04   ` [PATCH i-g-t 02/14] lib/igt_draw: Extend the API to support 64bpp colors Kamil Konieczny
2024-10-04 10:41 ` [PATCH i-g-t 03/14] lib/igt_draw: Support 64bpp int the mmap/pwrite paths Ville Syrjala
2024-10-22 15:55   ` Kamil Konieczny
2024-10-04 10:41 ` [PATCH i-g-t 04/14] lib/igt_draw: Support 8bpp " Ville Syrjala
2024-10-22 15:54   ` Kamil Konieczny
2024-10-04 10:41 ` [PATCH i-g-t 05/14] lib/igt_draw: Use function pointers for the linear<->tiled conversion Ville Syrjala
2024-11-12  9:59   ` Juha-Pekka Heikkilä
2024-10-04 10:41 ` [PATCH i-g-t 06/14] lib/igt_draw: Add support for gen2 and i915 tiling layouts Ville Syrjala
2024-11-12 16:08   ` Juha-Pekka Heikkilä
2024-10-04 10:41 ` [PATCH i-g-t 07/14] lib/igt_draw: Add 64bpp support to the XY_FAST_COLOR_BLT path Ville Syrjala
2024-10-29 15:02   ` Juha-Pekka Heikkila
2024-10-04 10:41 ` [PATCH i-g-t 08/14] lib/igt_draw: Add 64bpp support for the non-XY_FAST_COLOR_BLT path Ville Syrjala
2024-11-18 14:42   ` Juha-Pekka Heikkilä
2024-10-04 10:41 ` [PATCH i-g-t 09/14] lib/intel_bufops: Add support for gen2 and i915 tiling layouts Ville Syrjala
2024-10-04 10:41 ` [PATCH i-g-t 10/14] lib/intel_bufops: Provide pread/pwrite based fallback when we don't have WC Ville Syrjala
2024-10-22 15:51   ` Kamil Konieczny
2024-10-24 16:20   ` [PATCH i-g-t v2 " Ville Syrjala
2024-10-04 10:41 ` [PATCH i-g-t 11/14] lib/rendercopy: Use igt_require() to validate gen2/3 surface size Ville Syrjala
2024-10-22 16:21   ` Kamil Konieczny
2024-10-04 10:41 ` [PATCH i-g-t 12/14] tests/kms_draw_crc: Test 64bpp Ville Syrjala
2024-11-18 14:50   ` Juha-Pekka Heikkilä
2024-10-04 10:41 ` [PATCH i-g-t 13/14] lib/igt_aux: Add igt_ror() and igt_rol() Ville Syrjala
2024-10-22 15:52   ` Kamil Konieczny
2024-10-04 10:41 ` [PATCH i-g-t 14/14] tests/gem_draw: Test igt_draw without kms Ville Syrjala
2024-10-11 10:43   ` [PATCH i-g-t v2 " Ville Syrjala
2024-10-22 16:30     ` Kamil Konieczny
2024-10-23 12:21       ` Ville Syrjälä
2024-10-07 15:39 ` ✗ GitLab.Pipeline: warning for intel: igt_draw and intel_bufops improvements Patchwork
2024-10-10 19:41   ` Ville Syrjälä
2024-10-11  6:37     ` Zbigniew Kempczyński
2024-10-11  7:42       ` Kamil Konieczny
2024-10-11 10:25       ` Ville Syrjälä
2024-10-11  7:00     ` Zbigniew Kempczyński
2024-10-11  8:01       ` Piecielska, Katarzyna
2024-10-11 10:15       ` Ville Syrjälä
2024-10-11 15:23 ` ✓ Fi.CI.BAT: success for intel: igt_draw and intel_bufops improvements (rev2) Patchwork
2024-10-11 16:01 ` ✓ CI.xeBAT: " Patchwork
2024-10-11 19:55 ` ✗ CI.xeFULL: failure " Patchwork
2024-10-12  9:01 ` ✗ Fi.CI.IGT: " Patchwork
2024-10-24 18:03 ` ✓ Fi.CI.BAT: success for intel: igt_draw and intel_bufops improvements (rev3) Patchwork
2024-10-24 18:37 ` ✓ CI.xeBAT: " Patchwork
2024-10-24 20:53 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-10-25 22:48 ` ✗ CI.xeFULL: " Patchwork

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=20241004104121.32750-3-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@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