Commit a535aa67 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fbcon: convert copyarea() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 9ec52572
...@@ -50,7 +50,6 @@ enum { ...@@ -50,7 +50,6 @@ enum {
NvSubSw = 1, NvSubSw = 1,
NvSubImageBlit = 2, NvSubImageBlit = 2,
NvSub2D = 3, /* DO NOT CHANGE - hardcoded for kepler gr fifo */
NvSubCopy = 4, /* DO NOT CHANGE - hardcoded for kepler gr fifo */ NvSubCopy = 4, /* DO NOT CHANGE - hardcoded for kepler gr fifo */
}; };
......
...@@ -34,17 +34,17 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region) ...@@ -34,17 +34,17 @@ nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
struct nouveau_fbdev *nfbdev = info->par; struct nouveau_fbdev *nfbdev = info->par;
struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev); struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev);
struct nouveau_channel *chan = drm->channel; struct nouveau_channel *chan = drm->channel;
struct nvif_push *push = chan->chan.push;
int ret; int ret;
ret = RING_SPACE(chan, 4); ret = PUSH_WAIT(push, 4);
if (ret) if (ret)
return ret; return ret;
BEGIN_NV04(chan, NvSubImageBlit, 0x0300, 3); PUSH_NVSQ(push, NV05F, 0x0300, (region->sy << 16) | region->sx,
OUT_RING(chan, (region->sy << 16) | region->sx); 0x0304, (region->dy << 16) | region->dx,
OUT_RING(chan, (region->dy << 16) | region->dx); 0x0308, (region->height << 16) | region->width);
OUT_RING(chan, (region->height << 16) | region->width); PUSH_KICK(push);
FIRE_RING(chan);
return 0; return 0;
} }
......
...@@ -73,25 +73,23 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region) ...@@ -73,25 +73,23 @@ nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
struct nouveau_fbdev *nfbdev = info->par; struct nouveau_fbdev *nfbdev = info->par;
struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev); struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev);
struct nouveau_channel *chan = drm->channel; struct nouveau_channel *chan = drm->channel;
struct nvif_push *push = chan->chan.push;
int ret; int ret;
ret = RING_SPACE(chan, 12); ret = PUSH_WAIT(push, 12);
if (ret) if (ret)
return ret; return ret;
BEGIN_NV04(chan, NvSub2D, 0x0110, 1); PUSH_NVSQ(push, NV502D, 0x0110, 0);
OUT_RING(chan, 0); PUSH_NVSQ(push, NV502D, 0x08b0, region->dx,
BEGIN_NV04(chan, NvSub2D, 0x08b0, 4); 0x08b4, region->dy,
OUT_RING(chan, region->dx); 0x08b8, region->width,
OUT_RING(chan, region->dy); 0x08bc, region->height);
OUT_RING(chan, region->width); PUSH_NVSQ(push, NV502D, 0x08d0, 0,
OUT_RING(chan, region->height); 0x08d4, region->sx,
BEGIN_NV04(chan, NvSub2D, 0x08d0, 4); 0x08d8, 0,
OUT_RING(chan, 0); 0x08dc, region->sy);
OUT_RING(chan, region->sx); PUSH_KICK(push);
OUT_RING(chan, 0);
OUT_RING(chan, region->sy);
FIRE_RING(chan);
return 0; return 0;
} }
......
...@@ -73,25 +73,23 @@ nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region) ...@@ -73,25 +73,23 @@ nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region)
struct nouveau_fbdev *nfbdev = info->par; struct nouveau_fbdev *nfbdev = info->par;
struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev); struct nouveau_drm *drm = nouveau_drm(nfbdev->helper.dev);
struct nouveau_channel *chan = drm->channel; struct nouveau_channel *chan = drm->channel;
struct nvif_push *push = chan->chan.push;
int ret; int ret;
ret = RING_SPACE(chan, 12); ret = PUSH_WAIT(push, 11);
if (ret) if (ret)
return ret; return ret;
BEGIN_NVC0(chan, NvSub2D, 0x0110, 1); PUSH_NVIM(push, NV902D, 0x0110, 0);
OUT_RING (chan, 0); PUSH_NVSQ(push, NV902D, 0x08b0, region->dx,
BEGIN_NVC0(chan, NvSub2D, 0x08b0, 4); 0x08b4, region->dy,
OUT_RING (chan, region->dx); 0x08b8, region->width,
OUT_RING (chan, region->dy); 0x08bc, region->height);
OUT_RING (chan, region->width); PUSH_NVSQ(push, NV902D, 0x08d0, 0,
OUT_RING (chan, region->height); 0x08d4, region->sx,
BEGIN_NVC0(chan, NvSub2D, 0x08d0, 4); 0x08d8, 0,
OUT_RING (chan, 0); 0x08dc, region->sy);
OUT_RING (chan, region->sx); PUSH_KICK(push);
OUT_RING (chan, 0);
OUT_RING (chan, region->sy);
FIRE_RING(chan);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment