Skip to content

Commit f82fb64

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/gsp: add hal for disp.chan.dmac_alloc()
565.57.01 has incompatible changes to NV50VAIO_CHANNELDMA_ALLOCATION_PARAMETERS. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Timur Tabi <[email protected]> Tested-by: Timur Tabi <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 8887abb commit f82fb64

File tree

2 files changed

+22
-11
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm

2 files changed

+22
-11
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,27 +164,35 @@ r535_dmac_fini(struct nvkm_disp_chan *chan)
164164
r535_chan_fini(chan);
165165
}
166166

167+
static int
168+
r535_dmac_alloc(struct nvkm_disp *disp, u32 oclass, int inst, u32 put_offset,
169+
struct nvkm_gsp_object *dmac)
170+
{
171+
NV50VAIO_CHANNELDMA_ALLOCATION_PARAMETERS *args;
172+
173+
args = nvkm_gsp_rm_alloc_get(&disp->rm.object, (oclass << 16) | inst, oclass,
174+
sizeof(*args), dmac);
175+
if (IS_ERR(args))
176+
return PTR_ERR(args);
177+
178+
args->channelInstance = inst;
179+
args->offset = put_offset;
180+
181+
return nvkm_gsp_rm_alloc_wr(dmac, args);
182+
}
183+
167184
static int
168185
r535_dmac_init(struct nvkm_disp_chan *chan)
169186
{
170187
const struct nvkm_rm_api *rmapi = chan->disp->rm.objcom.client->gsp->rm->api;
171-
NV50VAIO_CHANNELDMA_ALLOCATION_PARAMETERS *args;
172188
int ret;
173189

174190
ret = rmapi->disp->chan.set_pushbuf(chan->disp, chan->object.oclass, chan->head, chan->memory);
175191
if (ret)
176192
return ret;
177193

178-
args = nvkm_gsp_rm_alloc_get(&chan->disp->rm.object,
179-
(chan->object.oclass << 16) | chan->head,
180-
chan->object.oclass, sizeof(*args), &chan->rm.object);
181-
if (IS_ERR(args))
182-
return PTR_ERR(args);
183-
184-
args->channelInstance = chan->head;
185-
args->offset = chan->suspend_put;
186-
187-
return nvkm_gsp_rm_alloc_wr(&chan->rm.object, args);
194+
return rmapi->disp->chan.dmac_alloc(chan->disp, chan->object.oclass, chan->head,
195+
chan->suspend_put, &chan->rm.object);
188196
}
189197

190198
static int
@@ -1780,5 +1788,6 @@ r535_disp = {
17801788
},
17811789
.chan = {
17821790
.set_pushbuf = r535_disp_chan_set_pushbuf,
1791+
.dmac_alloc = r535_dmac_alloc,
17831792
}
17841793
};

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ struct nvkm_rm_api {
9494
struct {
9595
int (*set_pushbuf)(struct nvkm_disp *, s32 oclass, int inst,
9696
struct nvkm_memory *);
97+
int (*dmac_alloc)(struct nvkm_disp *, u32 oclass, int inst, u32 put_offset,
98+
struct nvkm_gsp_object *);
9799
} chan;
98100
} *disp;
99101

0 commit comments

Comments
 (0)