Blob Blame History Raw
From 438611dd4289b7d631debffbacecdea5b6039e67 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Mon, 22 Jun 2020 14:16:03 +1000
Subject: drm/nouveau/fbcon/nv50-: use NVIDIA's headers for copyarea()
Git-commit: 95b1469e5cbaad02bc48043d4e159c6562b556b4
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 d99679086043..abab600056ae 100644
--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
@@ -82,15 +82,17 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
 	if (ret)
 		return ret;
 
-	PUSH_NVSQ(push, NV502D, 0x0110, 0);
-	PUSH_NVSQ(push, NV502D, 0x08b0, region->dx,
-				0x08b4, region->dy,
-				0x08b8, region->width,
-				0x08bc, region->height);
-	PUSH_NVSQ(push, NV502D, 0x08d0, 0,
-				0x08d4, region->sx,
-				0x08d8, 0,
-				0x08dc, region->sy);
+	PUSH_MTHD(push, NV502D, WAIT_FOR_IDLE, 0);
+
+	PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_MEMORY_DST_X0, region->dx,
+				SET_PIXELS_FROM_MEMORY_DST_Y0, region->dy,
+				SET_PIXELS_FROM_MEMORY_DST_WIDTH, region->width,
+				SET_PIXELS_FROM_MEMORY_DST_HEIGHT, region->height);
+
+	PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_MEMORY_SRC_X0_FRAC, 0,
+				SET_PIXELS_FROM_MEMORY_SRC_X0_INT, region->sx,
+				SET_PIXELS_FROM_MEMORY_SRC_Y0_FRAC, 0,
+				PIXELS_FROM_MEMORY_SRC_Y0_INT, region->sy);
 	PUSH_KICK(push);
 	return 0;
 }
diff --git a/drivers/gpu/drm/nouveau/nvc0_fbcon.c b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
index dd8e3e65ad84..4a09b7ecb30a 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fbcon.c
@@ -82,15 +82,17 @@ nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
 	if (ret)
 		return ret;
 
-	PUSH_NVIM(push, NV902D, 0x0110, 0);
-	PUSH_NVSQ(push, NV902D, 0x08b0, region->dx,
-				0x08b4, region->dy,
-				0x08b8, region->width,
-				0x08bc, region->height);
-	PUSH_NVSQ(push, NV902D, 0x08d0, 0,
-				0x08d4, region->sx,
-				0x08d8, 0,
-				0x08dc, region->sy);
+	PUSH_IMMD(push, NV902D, WAIT_FOR_IDLE, 0);
+
+	PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_MEMORY_DST_X0, region->dx,
+				SET_PIXELS_FROM_MEMORY_DST_Y0, region->dy,
+				SET_PIXELS_FROM_MEMORY_DST_WIDTH, region->width,
+				SET_PIXELS_FROM_MEMORY_DST_HEIGHT, region->height);
+
+	PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_MEMORY_SRC_X0_FRAC, 0,
+				SET_PIXELS_FROM_MEMORY_SRC_X0_INT, region->sx,
+				SET_PIXELS_FROM_MEMORY_SRC_Y0_FRAC, 0,
+				PIXELS_FROM_MEMORY_SRC_Y0_INT, region->sy);
 	PUSH_KICK(push);
 	return 0;
 }
-- 
2.29.2