Commit 4fbf03a3 authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent a5df7630
...@@ -31,7 +31,7 @@ struct nv50_head_func { ...@@ -31,7 +31,7 @@ struct nv50_head_func {
bool olut_identity; bool olut_identity;
int olut_size; int olut_size;
int (*olut_set)(struct nv50_head *, struct nv50_head_atom *); int (*olut_set)(struct nv50_head *, struct nv50_head_atom *);
void (*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 *); void (*core_set)(struct nv50_head *, struct nv50_head_atom *);
void (*core_clr)(struct nv50_head *); void (*core_clr)(struct nv50_head *);
...@@ -71,7 +71,7 @@ int head907d_view(struct nv50_head *, struct nv50_head_atom *); ...@@ -71,7 +71,7 @@ int head907d_view(struct nv50_head *, struct nv50_head_atom *);
int head907d_mode(struct nv50_head *, struct nv50_head_atom *); 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 *);
void head907d_olut_clr(struct nv50_head *); int head907d_olut_clr(struct nv50_head *);
void head907d_core_set(struct nv50_head *, struct nv50_head_atom *); void 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 *);
......
...@@ -231,16 +231,18 @@ head507d_core_calc(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -231,16 +231,18 @@ head507d_core_calc(struct nv50_head *head, struct nv50_head_atom *asyh)
asyh->core.pitch = ALIGN(asyh->core.w, 64) * 4; asyh->core.pitch = ALIGN(asyh->core.w, 64) * 4;
} }
static void static int
head507d_olut_clr(struct nv50_head *head) head507d_olut_clr(struct nv50_head *head)
{ {
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, 2))) { int ret;
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, core); return ret;
}
PUSH_NVSQ(push, NV507D, 0x0840 + (i * 0x400), 0x00000000);
return 0;
} }
static int static int
......
...@@ -76,18 +76,19 @@ head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -76,18 +76,19 @@ head827d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
static void static int
head827d_olut_clr(struct nv50_head *head) head827d_olut_clr(struct nv50_head *head)
{ {
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, 4))) { int ret;
evo_mthd(push, 0x0840 + (head->base.index * 0x400), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 4)))
evo_mthd(push, 0x085c + (head->base.index * 0x400), 1); return ret;
evo_data(push, 0x00000000);
evo_kick(push, core); PUSH_NVSQ(push, NV827D, 0x0840 + (i * 0x400), 0x00000000);
} PUSH_NVSQ(push, NV827D, 0x085c + (i * 0x400), 0x00000000);
return 0;
} }
static int static int
......
...@@ -194,18 +194,19 @@ head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -194,18 +194,19 @@ head907d_core_set(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
void int
head907d_olut_clr(struct nv50_head *head) head907d_olut_clr(struct nv50_head *head)
{ {
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, 4))) { int ret;
evo_mthd(push, 0x0448 + (head->base.index * 0x300), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 4)))
evo_mthd(push, 0x045c + (head->base.index * 0x300), 1); return ret;
evo_data(push, 0x00000000);
evo_kick(push, core); PUSH_NVSQ(push, NV907D, 0x0448 + (i * 0x300), 0x00000000);
} PUSH_NVSQ(push, NV907D, 0x045c + (i * 0x300), 0x00000000);
return 0;
} }
int int
......
...@@ -125,16 +125,18 @@ headc37d_curs_format(struct nv50_head *head, struct nv50_wndw_atom *asyw, ...@@ -125,16 +125,18 @@ headc37d_curs_format(struct nv50_head *head, struct nv50_wndw_atom *asyw,
return 0; return 0;
} }
static void static int
headc37d_olut_clr(struct nv50_head *head) headc37d_olut_clr(struct nv50_head *head)
{ {
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, 2))) { int ret;
evo_mthd(push, 0x20ac + (head->base.index * 0x400), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, core); return ret;
}
PUSH_NVSQ(push, NVC37D, 0x20ac + (i * 0x400), 0x00000000);
return 0;
} }
static int static int
......
...@@ -75,16 +75,18 @@ headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -75,16 +75,18 @@ headc57d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
void static int
headc57d_olut_clr(struct nv50_head *head) headc57d_olut_clr(struct nv50_head *head)
{ {
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, 2))) { int ret;
evo_mthd(push, 0x2288 + (head->base.index * 0x400), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 2)))
evo_kick(push, core); return ret;
}
PUSH_NVSQ(push, NVC57D, 0x2288 + (i * 0x400), 0x00000000);
return 0;
} }
static int static 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