From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 08/14] lib/igt_draw: Add 64bpp support for the non-XY_FAST_COLOR_BLT path
Date: Fri, 4 Oct 2024 13:41:15 +0300 [thread overview]
Message-ID: <20241004104121.32750-9-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>
XY_COLOR_BLT can't do 64bpp since we have nowhere to store
the other half of the color. In order to support 64bpp
pixel formats we have to get a little bit creative and
use XY_PAT_BLT_IMMEDIATE instead. We simply treat the
buffer as 32bpp, double the horizontal dimensions to
compensate, and alternate between the lower and upper
dwords of the color value when filling the 8x8 pattern.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
lib/igt_draw.c | 24 ++++++++++++++++++++++++
lib/intel_reg.h | 2 ++
2 files changed, 26 insertions(+)
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 2312a0c71030..81da01a6c5ad 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -833,6 +833,30 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
intel_bb_out(ibb, (1 << 29) | ((pitch-1) << 14) | (buf_height-1));
intel_bb_out(ibb, 0); /* mipmap levels / qpitch */
intel_bb_out(ibb, 0); /* mipmap index / alignment */
+ } else if (buf->bpp == 64) {
+ int x = rect->x * 2;
+ int w = rect->w * 2;
+
+ blt_cmd_depth = 3 << 24; /* 32bpp */
+ blt_cmd_len = ((ver >= 8) ? 0x4 : 0x3) + 8*8;
+ blt_cmd_tiling = (tiling) ? XY_COLOR_BLT_TILED : 0;
+ pitch = (ver >= 4 && tiling) ? buf->stride / 4 : buf->stride;
+
+ switch_blt_tiling(ibb, tiling, true);
+
+ intel_bb_out(ibb, XY_PAT_BLT_IMMEDIATE_CMD_NOLEN | XY_COLOR_BLT_WRITE_ALPHA |
+ XY_COLOR_BLT_WRITE_RGB | blt_cmd_tiling | blt_cmd_len);
+ intel_bb_out(ibb, blt_cmd_depth | (0xF0 << 16) | pitch);
+ intel_bb_out(ibb, (rect->y << 16) | x);
+ intel_bb_out(ibb, ((rect->y + rect->h) << 16) | (x + w));
+ intel_bb_emit_reloc_fenced(ibb, dst->handle, 0, I915_GEM_DOMAIN_RENDER,
+ 0, dst->addr.offset);
+ for (int i = 0; i < 8*8; i += 2) {
+ intel_bb_out(ibb, color);
+ intel_bb_out(ibb, color >> 32);
+ }
+
+ switch_blt_tiling(ibb, tiling, false);
} else {
switch (buf->bpp) {
case 8:
diff --git a/lib/intel_reg.h b/lib/intel_reg.h
index 26833c66f8e7..903b44b59fc3 100644
--- a/lib/intel_reg.h
+++ b/lib/intel_reg.h
@@ -2545,6 +2545,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define XY_COLOR_BLT_WRITE_RGB (1<<20)
#define XY_COLOR_BLT_TILED (1<<11)
+#define XY_PAT_BLT_IMMEDIATE_CMD_NOLEN ((2<<29)|(0x72<<22))
+
#define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1)
#define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21)
--
2.45.2
next prev 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 ` [PATCH i-g-t 02/14] lib/igt_draw: Extend the API to support 64bpp colors Ville Syrjala
2024-10-22 16:04 ` 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 ` Ville Syrjala [this message]
2024-11-18 14:42 ` [PATCH i-g-t 08/14] lib/igt_draw: Add 64bpp support for the non-XY_FAST_COLOR_BLT path 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-9-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