summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
index f393399baab1..687cb7378c69 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndwc57e.c
@@ -29,36 +29,33 @@
#include <nvif/clc37e.h>
#include <nvif/pushc37b.h>
-static void
+static int
wndwc57e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
- u32 *push;
-
- if (!(push = evo_wait(&wndw->wndw, 17)))
- return;
-
- evo_mthd(push, 0x0308, 1);
- evo_data(push, asyw->image.mode << 4 | asyw->image.interval);
- evo_mthd(push, 0x0224, 4);
- evo_data(push, asyw->image.h << 16 | asyw->image.w);
- evo_data(push, asyw->image.layout << 4 | asyw->image.blockh);
- evo_data(push, asyw->image.colorspace << 8 |
- asyw->image.format);
- evo_data(push, asyw->image.blocks[0] | (asyw->image.pitch[0] >> 6));
- evo_mthd(push, 0x0240, 1);
- evo_data(push, asyw->image.handle[0]);
- evo_mthd(push, 0x0260, 1);
- evo_data(push, asyw->image.offset[0] >> 8);
- evo_mthd(push, 0x0290, 1);
- evo_data(push, (asyw->state.src_y >> 16) << 16 |
- (asyw->state.src_x >> 16));
- evo_mthd(push, 0x0298, 1);
- evo_data(push, (asyw->state.src_h >> 16) << 16 |
- (asyw->state.src_w >> 16));
- evo_mthd(push, 0x02a4, 1);
- evo_data(push, asyw->state.crtc_h << 16 |
- asyw->state.crtc_w);
- evo_kick(push, &wndw->wndw);
+ struct nvif_push *push = wndw->wndw.push;
+ int ret;
+
+ if ((ret = PUSH_WAIT(push, 17)))
+ return ret;
+
+ PUSH_NVSQ(push, NVC57E, 0x0308, asyw->image.mode << 4 |
+ asyw->image.interval);
+ PUSH_NVSQ(push, NVC57E, 0x0224, asyw->image.h << 16 | asyw->image.w,
+ 0x0228, asyw->image.layout << 4 |
+ asyw->image.blockh,
+ 0x022c, asyw->image.colorspace << 8 |
+ asyw->image.format,
+ 0x0230, asyw->image.blocks[0] |
+ (asyw->image.pitch[0] >> 6));
+ PUSH_NVSQ(push, NVC57E, 0x0240, asyw->image.handle[0]);
+ PUSH_NVSQ(push, NVC57E, 0x0260, asyw->image.offset[0] >> 8);
+ PUSH_NVSQ(push, NVC57E, 0x0290,(asyw->state.src_y >> 16) << 16 |
+ (asyw->state.src_x >> 16));
+ PUSH_NVSQ(push, NVC57E, 0x0298,(asyw->state.src_h >> 16) << 16 |
+ (asyw->state.src_w >> 16));
+ PUSH_NVSQ(push, NVC57E, 0x02a4, asyw->state.crtc_h << 16 |
+ asyw->state.crtc_w);
+ return 0;
}
static int