Commit 1f772f5a authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 9ec5e820
...@@ -25,7 +25,7 @@ void nv50_head_flush_clr(struct nv50_head *head, ...@@ -25,7 +25,7 @@ void nv50_head_flush_clr(struct nv50_head *head,
struct nv50_head_atom *asyh, bool flush); struct nv50_head_atom *asyh, bool flush);
struct nv50_head_func { struct nv50_head_func {
void (*view)(struct nv50_head *, struct nv50_head_atom *); int (*view)(struct nv50_head *, struct nv50_head_atom *);
void (*mode)(struct nv50_head *, struct nv50_head_atom *); void (*mode)(struct nv50_head *, struct nv50_head_atom *);
bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int); bool (*olut)(struct nv50_head *, struct nv50_head_atom *, int);
bool olut_identity; bool olut_identity;
...@@ -50,7 +50,7 @@ struct nv50_head_func { ...@@ -50,7 +50,7 @@ struct nv50_head_func {
}; };
extern const struct nv50_head_func head507d; extern const struct nv50_head_func head507d;
void head507d_view(struct nv50_head *, struct nv50_head_atom *); int head507d_view(struct nv50_head *, struct nv50_head_atom *);
void head507d_mode(struct nv50_head *, struct nv50_head_atom *); void head507d_mode(struct nv50_head *, struct nv50_head_atom *);
bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int); bool head507d_olut(struct nv50_head *, struct nv50_head_atom *, int);
void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *); void head507d_core_calc(struct nv50_head *, struct nv50_head_atom *);
...@@ -67,7 +67,7 @@ void head507d_procamp(struct nv50_head *, struct nv50_head_atom *); ...@@ -67,7 +67,7 @@ void head507d_procamp(struct nv50_head *, struct nv50_head_atom *);
extern const struct nv50_head_func head827d; extern const struct nv50_head_func head827d;
extern const struct nv50_head_func head907d; extern const struct nv50_head_func head907d;
void head907d_view(struct nv50_head *, struct nv50_head_atom *); int head907d_view(struct nv50_head *, struct nv50_head_atom *);
void head907d_mode(struct nv50_head *, struct nv50_head_atom *); void 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);
void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *); void head907d_olut_set(struct nv50_head *, struct nv50_head_atom *);
...@@ -85,7 +85,7 @@ int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *, ...@@ -85,7 +85,7 @@ int head917d_curs_layout(struct nv50_head *, struct nv50_wndw_atom *,
struct nv50_head_atom *); struct nv50_head_atom *);
extern const struct nv50_head_func headc37d; extern const struct nv50_head_func headc37d;
void 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_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 *,
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include "head.h" #include "head.h"
#include "core.h" #include "core.h"
#include <nvif/push507c.h>
void void
head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh) head507d_procamp(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
...@@ -310,21 +312,21 @@ head507d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -310,21 +312,21 @@ head507d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
void int
head507d_view(struct nv50_head *head, struct nv50_head_atom *asyh) head507d_view(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, 7))) { int ret;
evo_mthd(push, 0x08a4 + (head->base.index * 0x400), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 7)))
evo_mthd(push, 0x08c8 + (head->base.index * 0x400), 1); return ret;
evo_data(push, asyh->view.iH << 16 | asyh->view.iW);
evo_mthd(push, 0x08d8 + (head->base.index * 0x400), 2); PUSH_NVSQ(push, NV507D, 0x08a4 + (i * 0x400), 0x00000000);
evo_data(push, asyh->view.oH << 16 | asyh->view.oW); PUSH_NVSQ(push, NV507D, 0x08c8 + (i * 0x400), asyh->view.iH << 16 | asyh->view.iW);
evo_data(push, asyh->view.oH << 16 | asyh->view.oW); PUSH_NVSQ(push, NV507D, 0x08d8 + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW,
evo_kick(push, core); 0x08dc + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW);
} return 0;
} }
const struct nv50_head_func const struct nv50_head_func
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "core.h" #include "core.h"
#include "crc.h" #include "crc.h"
#include <nvif/push507c.h>
void void
head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh) head907d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
...@@ -274,22 +276,22 @@ head907d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -274,22 +276,22 @@ head907d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
void int
head907d_view(struct nv50_head *head, struct nv50_head_atom *asyh) head907d_view(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, 8))) { int ret;
evo_mthd(push, 0x0494 + (head->base.index * 0x300), 1);
evo_data(push, 0x00000000); if ((ret = PUSH_WAIT(push, 8)))
evo_mthd(push, 0x04b8 + (head->base.index * 0x300), 1); return ret;
evo_data(push, asyh->view.iH << 16 | asyh->view.iW);
evo_mthd(push, 0x04c0 + (head->base.index * 0x300), 3); PUSH_NVSQ(push, NV907D, 0x0494 + (i * 0x300), 0x00000000);
evo_data(push, asyh->view.oH << 16 | asyh->view.oW); PUSH_NVSQ(push, NV907D, 0x04b8 + (i * 0x300), asyh->view.iH << 16 | asyh->view.iW);
evo_data(push, asyh->view.oH << 16 | asyh->view.oW); PUSH_NVSQ(push, NV907D, 0x04c0 + (i * 0x300), asyh->view.oH << 16 | asyh->view.oW,
evo_data(push, asyh->view.oH << 16 | asyh->view.oW); 0x04c4 + (i * 0x300), asyh->view.oH << 16 | asyh->view.oW,
evo_kick(push, core); 0x04c8 + (i * 0x300), asyh->view.oH << 16 | asyh->view.oW);
} return 0;
} }
const struct nv50_head_func const struct nv50_head_func
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include "atom.h" #include "atom.h"
#include "core.h" #include "core.h"
#include <nvif/pushc37b.h>
static void static void
headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh) headc37d_or(struct nv50_head *head, struct nv50_head_atom *asyh)
{ {
...@@ -190,18 +192,19 @@ headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -190,18 +192,19 @@ headc37d_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
} }
} }
void int
headc37d_view(struct nv50_head *head, struct nv50_head_atom *asyh) headc37d_view(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, 4))) { int ret;
evo_mthd(push, 0x204c + (head->base.index * 0x400), 1);
evo_data(push, (asyh->view.iH << 16) | asyh->view.iW); if ((ret = PUSH_WAIT(push, 4)))
evo_mthd(push, 0x2058 + (head->base.index * 0x400), 1); return ret;
evo_data(push, (asyh->view.oH << 16) | asyh->view.oW);
evo_kick(push, core); PUSH_NVSQ(push, NVC37D, 0x204c + (i * 0x400), asyh->view.iH << 16 | asyh->view.iW);
} PUSH_NVSQ(push, NVC37D, 0x2058 + (i * 0x400), asyh->view.oH << 16 | asyh->view.oW);
return 0;
} }
void void
......
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