diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc.h b/drivers/gpu/drm/nouveau/dispnv50/crc.h index 4bc59e7793151d2052691176f8e45d1739411ca3..0c10f84b1d62ae8e14e79425d0ce0de65b273c9f 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc.h +++ b/drivers/gpu/drm/nouveau/dispnv50/crc.h @@ -50,8 +50,8 @@ struct nv50_crc_atom { }; struct nv50_crc_func { - void (*set_src)(struct nv50_head *, int or, enum nv50_crc_source_type, - struct nv50_crc_notifier_ctx *, u32 wndw); + 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 *); u32 (*get_entry)(struct nv50_head *, struct nv50_crc_notifier_ctx *, enum nv50_crc_source, int idx); diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c index 92e907de76454d7257ebccf9b22def3e1b2854dd..1401cf245a4e00a8cc470fb21776a6ac68108e4a 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc907d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crc907d.c @@ -6,6 +6,8 @@ #include "disp.h" #include "head.h" +#include + #define CRC907D_MAX_ENTRIES 255 struct crc907d_notifier { @@ -18,16 +20,16 @@ struct crc907d_notifier { } entries[CRC907D_MAX_ENTRIES]; } __packed; -static void +static int crc907d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source, struct nv50_crc_notifier_ctx *ctx, u32 wndw) { struct drm_crtc *crtc = &head->base.base; - struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; - const u32 hoff = head->base.index * 0x300; - u32 *push; + struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + const int i = head->base.index; u32 crc_args = 0xfff00000; + int ret; switch (source) { case NV50_CRC_SOURCE_TYPE_SOR: @@ -50,22 +52,18 @@ crc907d_set_src(struct nv50_head *head, int or, break; } - push = evo_wait(core, 4); - if (!push) - return; + if ((ret = PUSH_WAIT(push, 4))) + return ret; if (source) { - evo_mthd(push, 0x0438 + hoff, 1); - evo_data(push, ctx->ntfy.handle); - evo_mthd(push, 0x0430 + hoff, 1); - evo_data(push, crc_args); + PUSH_NVSQ(push, NV907D, 0x0438 + (i * 0x300), ctx->ntfy.handle); + PUSH_NVSQ(push, NV907D, 0x0430 + (i * 0x300), crc_args); } else { - evo_mthd(push, 0x0430 + hoff, 1); - evo_data(push, crc_args); - evo_mthd(push, 0x0438 + hoff, 1); - evo_data(push, 0); + PUSH_NVSQ(push, NV907D, 0x0430 + (i * 0x300), crc_args); + PUSH_NVSQ(push, NV907D, 0x0438 + (i * 0x300), 0); } - evo_kick(push, core); + + return 0; } static void crc907d_set_ctx(struct nv50_head *head, diff --git a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c index 940cefd5517d5b4f931ef6af8e04a505ddb05fca..ab78f7ca85a390fb82e77ab2b109405abb670820 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crcc37d.c @@ -6,6 +6,8 @@ #include "disp.h" #include "head.h" +#include + #define CRCC37D_MAX_ENTRIES 2047 struct crcc37d_notifier { @@ -30,15 +32,15 @@ struct crcc37d_notifier { } entries[CRCC37D_MAX_ENTRIES]; } __packed; -static void +static int crcc37d_set_src(struct nv50_head *head, int or, enum nv50_crc_source_type source, struct nv50_crc_notifier_ctx *ctx, u32 wndw) { - struct nv50_dmac *core = &nv50_disp(head->base.base.dev)->core->chan; - const u32 hoff = head->base.index * 0x400; - u32 *push; + struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; + const int i = head->base.index; u32 crc_args; + int ret; switch (source) { case NV50_CRC_SOURCE_TYPE_SOR: @@ -55,23 +57,18 @@ crcc37d_set_src(struct nv50_head *head, int or, break; } - push = evo_wait(core, 4); - if (!push) - return; + if ((ret = PUSH_WAIT(push, 4))) + return ret; if (source) { - evo_mthd(push, 0x2180 + hoff, 1); - evo_data(push, ctx->ntfy.handle); - evo_mthd(push, 0x2184 + hoff, 1); - evo_data(push, crc_args | wndw); + PUSH_NVSQ(push, NVC37D, 0x2180 + (i * 0x400), ctx->ntfy.handle); + PUSH_NVSQ(push, NVC37D, 0x2184 + (i * 0x400), crc_args | wndw); } else { - evo_mthd(push, 0x2184 + hoff, 1); - evo_data(push, 0); - evo_mthd(push, 0x2180 + hoff, 1); - evo_data(push, 0); + PUSH_NVSQ(push, NVC37D, 0x2184 + (i * 0x400), 0); + PUSH_NVSQ(push, NVC37D, 0x2180 + (i * 0x400), 0); } - evo_kick(push, core); + return 0; } static void crcc37d_set_ctx(struct nv50_head *head,