summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-07-18 17:42:27 +1000
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:56 +1000
commitae09163ac27ce7d576d7bd2e941eacaef8d491c1 (patch)
tree38de4278e8b67ebf52df1717c61289ac8d22a2a3 /drivers
parentc4b27bc8682c5d919a7e95c7cb3e2021d8b37c92 (diff)
downloadlinux-stable-ae09163ac27ce7d576d7bd2e941eacaef8d491c1.tar.gz
linux-stable-ae09163ac27ce7d576d7bd2e941eacaef8d491c1.tar.bz2
linux-stable-ae09163ac27ce7d576d7bd2e941eacaef8d491c1.zip
drm/nouveau/kms/nv50-: convert core crc_set_ctx() to new push macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/crc.h2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/crc907d.c18
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/crcc37d.c18
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/disp.h14
4 files changed, 19 insertions, 33 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc.h b/drivers/gpu/drm/nouveau/dispnv50/crc.h
index 0c10f84b1d62..ffb7b7c19570 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/crc.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/crc.h
@@ -52,7 +52,7 @@ struct nv50_crc_atom {
struct nv50_crc_func {
int (*set_src)(struct nv50_head *, int or, enum nv50_crc_source_type,
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 *,
enum nv50_crc_source, int idx);
bool (*ctx_finished)(struct nv50_head *,
diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c
index 1401cf245a4e..75728dc99b64 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c
@@ -66,18 +66,18 @@ crc907d_set_src(struct nv50_head *head, int or,
return 0;
}
-static void crc907d_set_ctx(struct nv50_head *head,
- struct nv50_crc_notifier_ctx *ctx)
+static int
+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;
- u32 *push = evo_wait(core, 2);
+ struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+ const int i = head->base.index;
+ int ret;
- if (!push)
- return;
+ if ((ret = PUSH_WAIT(push, 2)))
+ return ret;
- evo_mthd(push, 0x0438 + (head->base.index * 0x300), 1);
- evo_data(push, ctx ? ctx->ntfy.handle : 0);
- evo_kick(push, core);
+ PUSH_NVSQ(push, NV907D, 0x0438 + (i * 0x300), ctx ? ctx->ntfy.handle : 0);
+ return 0;
}
static u32 crc907d_get_entry(struct nv50_head *head,
diff --git a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c
index ab78f7ca85a3..dd818931db09 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c
@@ -71,18 +71,18 @@ crcc37d_set_src(struct nv50_head *head, int or,
return 0;
}
-static void crcc37d_set_ctx(struct nv50_head *head,
- struct nv50_crc_notifier_ctx *ctx)
+static int
+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;
- u32 *push = evo_wait(core, 2);
+ struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push;
+ const int i = head->base.index;
+ int ret;
- if (!push)
- return;
+ if ((ret = PUSH_WAIT(push, 2)))
+ return ret;
- evo_mthd(push, 0x2180 + (head->base.index * 0x400), 1);
- evo_data(push, ctx ? ctx->ntfy.handle : 0);
- evo_kick(push, core);
+ PUSH_NVSQ(push, NVC37D, 0x2180 + (i * 0x400), ctx ? ctx->ntfy.handle : 0);
+ return 0;
}
static u32 crcc37d_get_entry(struct nv50_head *head,
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
index 746ab75d15c3..fbf573a01f58 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
@@ -108,18 +108,4 @@ void evo_kick(u32 *, struct nv50_dmac *);
extern const u64 disp50xx_modifiers[];
extern const u64 disp90xx_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