Commit a38870a2 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50-: convert core head_core_set() to new push macros

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 4fbf03a3
...@@ -33,7 +33,7 @@ struct nv50_head_func { ...@@ -33,7 +33,7 @@ struct nv50_head_func {
int (*olut_set)(struct nv50_head *, struct nv50_head_atom *); int (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
int (*olut_clr)(struct nv50_head *); int (*olut_clr)(struct nv50_head *);
void (*core_calc)(struct nv50_head *, struct nv50_head_atom *); void (*core_calc)(struct nv50_head *, struct nv50_head_atom *);
void (*core_set)(struct nv50_head *, struct nv50_head_atom *); int (*core_set)(struct nv50_head *, struct nv50_head_atom *);
void (*core_clr)(struct nv50_head *); void (*core_clr)(struct nv50_head *);
int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *, int (*curs_layout)(struct nv50_head *, struct nv50_wndw_atom *,
struct nv50_head_atom *); struct nv50_head_atom *);
...@@ -72,7 +72,7 @@ int head907d_mode(struct nv50_head *, struct nv50_head_atom *); ...@@ -72,7 +72,7 @@ int head907d_mode(struct nv50_head *, struct nv50_head_atom *);
bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int); bool head907d_olut(struct nv50_head *, struct nv50_head_atom *, int);
int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *); int head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
int head907d_olut_clr(struct nv50_head *); int head907d_olut_clr(struct nv50_head *);
void head907d_core_set(struct nv50_head *, struct nv50_head_atom *); int head907d_core_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_core_clr(struct nv50_head *); void head907d_core_clr(struct nv50_head *);
void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *); void head907d_curs_set(struct nv50_head *, struct nv50_head_atom *);
void head907d_curs_clr(struct nv50_head *); void head907d_curs_clr(struct nv50_head *);
...@@ -86,7 +86,6 @@ int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *, ...@@ -86,7 +86,6 @@ int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
extern const struct nv50_head_func headc37d; extern const struct nv50_head_func headc37d;
int headc37d_view(struct nv50_head *, struct nv50_head_atom *); int headc37d_view(struct nv50_head *, struct nv50_head_atom *);
void headc37d_core_set(struct nv50_head *, struct nv50_head_atom *);
void headc37d_core_clr(struct nv50_head *); void headc37d_core_clr(struct nv50_head *);
int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *, int headc37d_curs_format(struct nv50_head *, struct nv50_wndw_atom *,
struct nv50_head_atom *); struct nv50_head_atom *);
......
...@@ -169,26 +169,26 @@ head507d_core_clr(struct nv50_head *head) ...@@ -169,26 +169,26 @@ head507d_core_clr(struct nv50_head *head)
} }
} }
static void static int
head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 9))) { int ret;
evo_mthd(push, 0x0860 + head->base.index * 0x400, 1);
evo_data(push, asyh->core.offset >> 8); if ((ret = PUSH_WAIT(push, 9)))
evo_mthd(push, 0x0868 + head->base.index * 0x400, 4); return ret;
evo_data(push, asyh->core.h << 16 | asyh->core.w);
evo_data(push, asyh->core.layout << 20 | PUSH_NVSQ(push, NV507D, 0x0860 + (i * 0x400), asyh->core.offset >> 8);
PUSH_NVSQ(push, NV507D, 0x0868 + (i * 0x400), asyh->core.h << 16 | asyh->core.w,
0x086c + (i * 0x400), asyh->core.layout << 20 |
(asyh->core.pitch >> 8) << 8 | (asyh->core.pitch >> 8) << 8 |
asyh->core.blocks << 8 | asyh->core.blocks << 8 |
asyh->core.blockh); asyh->core.blockh,
evo_data(push, asyh->core.kind << 16 | 0x0870 + (i * 0x400), asyh->core.kind << 16 |
asyh->core.format << 8); asyh->core.format << 8,
evo_data(push, asyh->core.handle); 0x0874 + (i * 0x400), asyh->core.handle);
evo_mthd(push, 0x08c0 + head->base.index * 0x400, 1); PUSH_NVSQ(push, NV507D, 0x08c0 + (i * 0x400), asyh->core.y << 16 | asyh->core.x);
evo_data(push, asyh->core.y << 16 | asyh->core.x);
evo_kick(push, core);
/* EVO will complain with INVALID_STATE if we have an /* EVO will complain with INVALID_STATE if we have an
* active cursor and (re)specify HeadSetContextDmaIso * active cursor and (re)specify HeadSetContextDmaIso
...@@ -196,7 +196,7 @@ head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -196,7 +196,7 @@ head507d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
*/ */
asyh->set.curs = asyh->curs.visible; asyh->set.curs = asyh->curs.visible;
asyh->set.olut = asyh->olut.handle != 0; asyh->set.olut = asyh->olut.handle != 0;
} return 0;
} }
void void
......
...@@ -54,26 +54,26 @@ head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -54,26 +54,26 @@ head827d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
static void static int
head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 9))) { int ret;
evo_mthd(push, 0x0860 + head->base.index * 0x400, 1);
evo_data(push, asyh->core.offset >> 8); if ((ret = PUSH_WAIT(push, 9)))
evo_mthd(push, 0x0868 + head->base.index * 0x400, 4); return ret;
evo_data(push, asyh->core.h << 16 | asyh->core.w);
evo_data(push, asyh->core.layout << 20 | PUSH_NVSQ(push, NV827D, 0x0860 + (i * 0x400), asyh->core.offset >> 8);
PUSH_NVSQ(push, NV827D, 0x0868 + (i * 0x400), asyh->core.h << 16 | asyh->core.w,
0x086c + (i * 0x400), asyh->core.layout << 20 |
(asyh->core.pitch >> 8) << 8 | (asyh->core.pitch >> 8) << 8 |
asyh->core.blocks << 8 | asyh->core.blocks << 8 |
asyh->core.blockh); asyh->core.blockh,
evo_data(push, asyh->core.format << 8); 0x0870 + (i * 0x400), asyh->core.format << 8,
evo_data(push, asyh->core.handle); 0x0874 + (i * 0x400), asyh->core.handle);
evo_mthd(push, 0x08c0 + head->base.index * 0x400, 1); PUSH_NVSQ(push, NV827D, 0x08c0 + (i * 0x400), asyh->core.y << 16 | asyh->core.x);
evo_data(push, asyh->core.y << 16 | asyh->core.x); return 0;
evo_kick(push, core);
}
} }
static int static int
......
...@@ -172,26 +172,26 @@ head907d_core_clr(struct nv50_head *head) ...@@ -172,26 +172,26 @@ head907d_core_clr(struct nv50_head *head)
} }
} }
void int
head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
u32 *push; const int i = head->base.index;
if ((push = evo_wait(core, 9))) { int ret;
evo_mthd(push, 0x0460 + head->base.index * 0x300, 1);
evo_data(push, asyh->core.offset >> 8); if ((ret = PUSH_WAIT(push, 9)))
evo_mthd(push, 0x0468 + head->base.index * 0x300, 4); return ret;
evo_data(push, asyh->core.h << 16 | asyh->core.w);
evo_data(push, asyh->core.layout << 24 | PUSH_NVSQ(push, NV907D, 0x0460 + (i * 0x300), asyh->core.offset >> 8);
PUSH_NVSQ(push, NV907D, 0x0468 + (i * 0x300), asyh->core.h << 16 | asyh->core.w,
0x046c + (i * 0x300), asyh->core.layout << 24 |
(asyh->core.pitch >> 8) << 8 | (asyh->core.pitch >> 8) << 8 |
asyh->core.blocks << 8 | asyh->core.blocks << 8 |
asyh->core.blockh); asyh->core.blockh,
evo_data(push, asyh->core.format << 8); 0x0470 + (i * 0x300), asyh->core.format << 8,
evo_data(push, asyh->core.handle); 0x0474 + (i * 0x300), asyh->core.handle);
evo_mthd(push, 0x04b0 + head->base.index * 0x300, 1); PUSH_NVSQ(push, NV907D, 0x04b0 + (i * 0x300), asyh->core.y << 16 | asyh->core.x);
evo_data(push, asyh->core.y << 16 | asyh->core.x); return 0;
evo_kick(push, core);
}
} }
int int
......
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