Blob Blame History Raw
From 1e8bc64dde97cdfc65fb4a91134d8c961e8d1af1 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 22 Jun 2020 14:12:07 +1000
Subject: drm/nouveau/fbcon/nv50-: use NVIDIA's headers for imageblit()
Git-commit: c7acff989428533f5877f02f57c97743ece6f1f0
Patch-mainline: v5.9-rc1
References: jsc#SLE-12680, jsc#SLE-12880, jsc#SLE-12882, jsc#SLE-12883, jsc#SLE-13496, jsc#SLE-15322

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/nouveau/nv50_fbcon.c | 20 +++++++++++---------
 drivers/gpu/drm/nouveau/nvc0_fbcon.c | 20 +++++++++++---------
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_fbcon.c b/drivers/gpu/drm/nouveau/nv50_fbcon.c
index 9001b30f7214..d99679086043 100644
--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
@@ -123,14 +123,16 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
 	if (ret)
 		return ret;
 
-	PUSH_NVSQ(push, NV502D, 0x0814, bg,
-				0x0818, fg);
-	PUSH_NVSQ(push, NV502D, 0x0838, image->width,
-				0x083c, image->height);
-	PUSH_NVSQ(push, NV502D, 0x0850, 0,
-				0x0854, image->dx,
-				0x0858, 0,
-				0x085c, image->dy);
+	PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_COLOR0, bg,
+				SET_PIXELS_FROM_CPU_COLOR1, fg);
+
+	PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_SRC_WIDTH, image->width,
+				SET_PIXELS_FROM_CPU_SRC_HEIGHT, image->height);
+
+	PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_DST_X0_FRAC, 0,
+				SET_PIXELS_FROM_CPU_DST_X0_INT, image->dx,
+				SET_PIXELS_FROM_CPU_DST_Y0_FRAC, 0,
+				SET_PIXELS_FROM_CPU_DST_Y0_INT, image->dy);
 
 	dwords = ALIGN(ALIGN(image->width, 8) * image->height, 32) >> 5;
 	while (dwords) {
@@ -142,7 +144,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
 
 		dwords -= count;
 
-		PUSH_NVNI(push, NV502D, 0x0860, data, count);
+		PUSH_NINC(push, NV502D, PIXELS_FROM_CPU_DATA, data, count);
 		data += count;
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nvc0_fbcon.c b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
index 1f4ca42b940e..dd8e3e65ad84 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
@@ -123,14 +123,16 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
 	if (ret)
 		return ret;
 
-	PUSH_NVSQ(push, NV902D, 0x0814, bg,
-				0x0818, fg);
-	PUSH_NVSQ(push, NV902D, 0x0838, image->width,
-				0x083c, image->height);
-	PUSH_NVSQ(push, NV902D, 0x0850, 0,
-				0x0854, image->dx,
-				0x0858, 0,
-				0x085c, image->dy);
+	PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_COLOR0, bg,
+				SET_PIXELS_FROM_CPU_COLOR1, fg);
+
+	PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_SRC_WIDTH, image->width,
+				SET_PIXELS_FROM_CPU_SRC_HEIGHT, image->height);
+
+	PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_DST_X0_FRAC, 0,
+				SET_PIXELS_FROM_CPU_DST_X0_INT, image->dx,
+				SET_PIXELS_FROM_CPU_DST_Y0_FRAC, 0,
+				SET_PIXELS_FROM_CPU_DST_Y0_INT, image->dy);
 
 	dwords = ALIGN(ALIGN(image->width, 8) * image->height, 32) >> 5;
 	while (dwords) {
@@ -142,7 +144,7 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
 
 		dwords -= count;
 
-		PUSH_NVNI(push, NV902D, 0x0860, data, count);
+		PUSH_NINC(push, NV902D, PIXELS_FROM_CPU_DATA, data, count);
 		data += count;
 	}
 
-- 
2.29.2