Commit ae09163a authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent c4b27bc8
...@@ -52,7 +52,7 @@ struct nv50_crc_atom { ...@@ -52,7 +52,7 @@ struct nv50_crc_atom {
struct nv50_crc_func { struct nv50_crc_func {
int (*set_src)(struct nv50_head *, int or, enum nv50_crc_source_type, int (*set_src)(struct nv50_head *, int or, enum nv50_crc_source_type,
struct nv50_crc_notifier_ctx *, u32 wndw); struct nv50_crc_notifier_ctx *, u32 wndw);
void (*set_ctx)(struct nv50_head *, struct nv50_crc_notifier_ctx *); int (*set_ctx)(struct nv50_head *, struct nv50_crc_notifier_ctx *);
u32 (*get_entry)(struct nv50_head *, struct nv50_crc_notifier_ctx *, u32 (*get_entry)(struct nv50_head *, struct nv50_crc_notifier_ctx *,
enum nv50_crc_source, int idx); enum nv50_crc_source, int idx);
bool (*ctx_finished)(struct nv50_head *, bool (*ctx_finished)(struct nv50_head *,
......
...@@ -66,18 +66,18 @@ crc907d_set_src(struct nv50_head *head, int or, ...@@ -66,18 +66,18 @@ crc907d_set_src(struct nv50_head *head, int or,
return 0; return 0;
} }
static void crc907d_set_ctx(struct nv50_head *head, static int
struct nv50_crc_notifier_ctx *ctx) crc907d_set_ctx(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx)
{ {
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 = evo_wait(core, 2); const int i = head->base.index;
int ret;
if (!push) if ((ret = PUSH_WAIT(push, 2)))
return; return ret;
evo_mthd(push, 0x0438 + (head->base.index * 0x300), 1); PUSH_NVSQ(push, NV907D, 0x0438 + (i * 0x300), ctx ? ctx->ntfy.handle : 0);
evo_data(push, ctx ? ctx->ntfy.handle : 0); return 0;
evo_kick(push, core);
} }
static u32 crc907d_get_entry(struct nv50_head *head, static u32 crc907d_get_entry(struct nv50_head *head,
......
...@@ -71,18 +71,18 @@ crcc37d_set_src(struct nv50_head *head, int or, ...@@ -71,18 +71,18 @@ crcc37d_set_src(struct nv50_head *head, int or,
return 0; return 0;
} }
static void crcc37d_set_ctx(struct nv50_head *head, static int
struct nv50_crc_notifier_ctx *ctx) crcc37d_set_ctx(struct nv50_head *head, struct nv50_crc_notifier_ctx *ctx)
{ {
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 = evo_wait(core, 2); const int i = head->base.index;
int ret;
if (!push) if ((ret = PUSH_WAIT(push, 2)))
return; return ret;
evo_mthd(push, 0x2180 + (head->base.index * 0x400), 1); PUSH_NVSQ(push, NVC37D, 0x2180 + (i * 0x400), ctx ? ctx->ntfy.handle : 0);
evo_data(push, ctx ? ctx->ntfy.handle : 0); return 0;
evo_kick(push, core);
} }
static u32 crcc37d_get_entry(struct nv50_head *head, static u32 crcc37d_get_entry(struct nv50_head *head,
......
...@@ -108,18 +108,4 @@ void evo_kick(u32 *, struct nv50_dmac *); ...@@ -108,18 +108,4 @@ void evo_kick(u32 *, struct nv50_dmac *);
extern const u64 disp50xx_modifiers[]; extern const u64 disp50xx_modifiers[];
extern const u64 disp90xx_modifiers[]; extern const u64 disp90xx_modifiers[];
extern const u64 wndwc57e_modifiers[]; extern const u64 wndwc57e_modifiers[];
#define evo_mthd(p, m, s) do { \
const u32 _m = (m), _s = (s); \
if (drm_debug_enabled(DRM_UT_KMS)) \
pr_err("%04x %d %s\n", _m, _s, __func__); \
*((p)++) = ((_s << 18) | _m); \
} while(0)
#define evo_data(p, d) do { \
const u32 _d = (d); \
if (drm_debug_enabled(DRM_UT_KMS)) \
pr_err("\t%08x\n", _d); \
*((p)++) = _d; \
} while(0)
#endif #endif
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