Skip to content

Commit a38f83d

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

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

drivers/gpu/drm/nouveau/nv50_fbcon.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
5252
return ret;
5353

5454
if (rect->rop != ROP_COPY) {
55-
PUSH_NVSQ(push, NV502D, 0x02ac, 1);
55+
PUSH_MTHD(push, NV502D, SET_OPERATION,
56+
NVDEF(NV502D, SET_OPERATION, V, ROP_AND));
5657
}
5758

58-
PUSH_NVSQ(push, NV502D, 0x0588, colour);
59-
PUSH_NVSQ(push, NV502D, 0x0600, rect->dx,
60-
0x0604, rect->dy,
61-
0x0608, rect->dx + rect->width,
62-
0x060c, rect->dy + rect->height);
59+
PUSH_MTHD(push, NV502D, SET_RENDER_SOLID_PRIM_COLOR, colour);
60+
61+
PUSH_MTHD(push, NV502D, RENDER_SOLID_PRIM_POINT_SET_X(0), rect->dx,
62+
RENDER_SOLID_PRIM_POINT_Y(0), rect->dy,
63+
RENDER_SOLID_PRIM_POINT_SET_X(1), rect->dx + rect->width,
64+
RENDER_SOLID_PRIM_POINT_Y(1), rect->dy + rect->height);
6365

6466
if (rect->rop != ROP_COPY) {
65-
PUSH_NVSQ(push, NV502D, 0x02ac, 3);
67+
PUSH_MTHD(push, NV502D, SET_OPERATION,
68+
NVDEF(NV502D, SET_OPERATION, V, SRCCOPY));
6669
}
6770

6871
PUSH_KICK(push);

drivers/gpu/drm/nouveau/nvc0_fbcon.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,20 @@ nvc0_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
5252
return ret;
5353

5454
if (rect->rop != ROP_COPY) {
55-
PUSH_NVIM(push, NV902D, 0x02ac, 1);
55+
PUSH_IMMD(push, NV902D, SET_OPERATION,
56+
NVDEF(NV902D, SET_OPERATION, V, ROP_AND));
5657
}
5758

58-
PUSH_NVSQ(push, NV902D, 0x0588, colour);
59-
PUSH_NVSQ(push, NV902D, 0x0600, rect->dx,
60-
0x0604, rect->dy,
61-
0x0608, rect->dx + rect->width,
62-
0x060c, rect->dy + rect->height);
59+
PUSH_MTHD(push, NV902D, SET_RENDER_SOLID_PRIM_COLOR, colour);
60+
61+
PUSH_MTHD(push, NV902D, RENDER_SOLID_PRIM_POINT_SET_X(0), rect->dx,
62+
RENDER_SOLID_PRIM_POINT_Y(0), rect->dy,
63+
RENDER_SOLID_PRIM_POINT_SET_X(1), rect->dx + rect->width,
64+
RENDER_SOLID_PRIM_POINT_Y(1), rect->dy + rect->height);
6365

6466
if (rect->rop != ROP_COPY) {
65-
PUSH_NVIM(push, NV902D, 0x02ac, 3);
67+
PUSH_IMMD(push, NV902D, SET_OPERATION,
68+
NVDEF(NV902D, SET_OPERATION, V, SRCCOPY));
6669
}
6770

6871
PUSH_KICK(push);

0 commit comments

Comments
 (0)