Skip to content

Commit c7acff9

Browse files
author
Ben Skeggs
committed
drm/nouveau/fbcon/nv50-: use NVIDIA's headers for imageblit()
Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Lyude Paul <[email protected]>
1 parent 5755b1e commit c7acff9

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

drivers/gpu/drm/nouveau/nv50_fbcon.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,16 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
123123
if (ret)
124124
return ret;
125125

126-
PUSH_NVSQ(push, NV502D, 0x0814, bg,
127-
0x0818, fg);
128-
PUSH_NVSQ(push, NV502D, 0x0838, image->width,
129-
0x083c, image->height);
130-
PUSH_NVSQ(push, NV502D, 0x0850, 0,
131-
0x0854, image->dx,
132-
0x0858, 0,
133-
0x085c, image->dy);
126+
PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_COLOR0, bg,
127+
SET_PIXELS_FROM_CPU_COLOR1, fg);
128+
129+
PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_SRC_WIDTH, image->width,
130+
SET_PIXELS_FROM_CPU_SRC_HEIGHT, image->height);
131+
132+
PUSH_MTHD(push, NV502D, SET_PIXELS_FROM_CPU_DST_X0_FRAC, 0,
133+
SET_PIXELS_FROM_CPU_DST_X0_INT, image->dx,
134+
SET_PIXELS_FROM_CPU_DST_Y0_FRAC, 0,
135+
SET_PIXELS_FROM_CPU_DST_Y0_INT, image->dy);
134136

135137
dwords = ALIGN(ALIGN(image->width, 8) * image->height, 32) >> 5;
136138
while (dwords) {
@@ -142,7 +144,7 @@ nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
142144

143145
dwords -= count;
144146

145-
PUSH_NVNI(push, NV502D, 0x0860, data, count);
147+
PUSH_NINC(push, NV502D, PIXELS_FROM_CPU_DATA, data, count);
146148
data += count;
147149
}
148150

drivers/gpu/drm/nouveau/nvc0_fbcon.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,16 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
123123
if (ret)
124124
return ret;
125125

126-
PUSH_NVSQ(push, NV902D, 0x0814, bg,
127-
0x0818, fg);
128-
PUSH_NVSQ(push, NV902D, 0x0838, image->width,
129-
0x083c, image->height);
130-
PUSH_NVSQ(push, NV902D, 0x0850, 0,
131-
0x0854, image->dx,
132-
0x0858, 0,
133-
0x085c, image->dy);
126+
PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_COLOR0, bg,
127+
SET_PIXELS_FROM_CPU_COLOR1, fg);
128+
129+
PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_SRC_WIDTH, image->width,
130+
SET_PIXELS_FROM_CPU_SRC_HEIGHT, image->height);
131+
132+
PUSH_MTHD(push, NV902D, SET_PIXELS_FROM_CPU_DST_X0_FRAC, 0,
133+
SET_PIXELS_FROM_CPU_DST_X0_INT, image->dx,
134+
SET_PIXELS_FROM_CPU_DST_Y0_FRAC, 0,
135+
SET_PIXELS_FROM_CPU_DST_Y0_INT, image->dy);
134136

135137
dwords = ALIGN(ALIGN(image->width, 8) * image->height, 32) >> 5;
136138
while (dwords) {
@@ -142,7 +144,7 @@ nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
142144

143145
dwords -= count;
144146

145-
PUSH_NVNI(push, NV902D, 0x0860, data, count);
147+
PUSH_NINC(push, NV902D, PIXELS_FROM_CPU_DATA, data, count);
146148
data += count;
147149
}
148150

0 commit comments

Comments
 (0)