nouveau: wrap nouveau_bo_map
This makes it easier to insert locking code around libdrm. Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: M Henning <drawoc@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10752>
This commit is contained in:
@@ -168,7 +168,7 @@ nouveau_transfer_staging(struct nouveau_context *nv,
|
||||
nouveau_mm_allocate(nv->screen->mm_GART, size, &tx->bo, &tx->offset);
|
||||
if (tx->bo) {
|
||||
tx->offset += adj;
|
||||
if (!nouveau_bo_map(tx->bo, 0, NULL))
|
||||
if (!BO_MAP(nv->screen, tx->bo, 0, NULL))
|
||||
tx->map = (uint8_t *)tx->bo->map + tx->offset;
|
||||
}
|
||||
}
|
||||
@@ -471,9 +471,9 @@ nouveau_buffer_transfer_map(struct pipe_context *pipe,
|
||||
* wait on the whole slab and instead use the logic below to return a
|
||||
* reasonable buffer for that case.
|
||||
*/
|
||||
ret = nouveau_bo_map(buf->bo,
|
||||
buf->mm ? 0 : nouveau_screen_transfer_flags(usage),
|
||||
nv->client);
|
||||
ret = BO_MAP(nv->screen, buf->bo,
|
||||
buf->mm ? 0 : nouveau_screen_transfer_flags(usage),
|
||||
nv->client);
|
||||
if (ret) {
|
||||
FREE(tx);
|
||||
return NULL;
|
||||
@@ -639,10 +639,10 @@ nouveau_resource_map_offset(struct nouveau_context *nv,
|
||||
unsigned rw;
|
||||
rw = (flags & NOUVEAU_BO_WR) ? PIPE_MAP_WRITE : PIPE_MAP_READ;
|
||||
nouveau_buffer_sync(nv, res, rw);
|
||||
if (nouveau_bo_map(res->bo, 0, NULL))
|
||||
if (BO_MAP(nv->screen, res->bo, 0, NULL))
|
||||
return NULL;
|
||||
} else {
|
||||
if (nouveau_bo_map(res->bo, flags, nv->client))
|
||||
if (BO_MAP(nv->screen, res->bo, flags, nv->client))
|
||||
return NULL;
|
||||
}
|
||||
return (uint8_t *)res->bo->map + res->offset + offset;
|
||||
@@ -798,7 +798,7 @@ nouveau_buffer_data_fetch(struct nouveau_context *nv, struct nv04_resource *buf,
|
||||
{
|
||||
if (!nouveau_buffer_malloc(buf))
|
||||
return false;
|
||||
if (nouveau_bo_map(bo, NOUVEAU_BO_RD, nv->client))
|
||||
if (BO_MAP(nv->screen, bo, NOUVEAU_BO_RD, nv->client))
|
||||
return false;
|
||||
memcpy(buf->data, (uint8_t *)bo->map + offset, size);
|
||||
return true;
|
||||
@@ -823,7 +823,7 @@ nouveau_buffer_migrate(struct nouveau_context *nv,
|
||||
if (new_domain == NOUVEAU_BO_GART && old_domain == 0) {
|
||||
if (!nouveau_buffer_allocate(screen, buf, new_domain))
|
||||
return false;
|
||||
ret = nouveau_bo_map(buf->bo, 0, nv->client);
|
||||
ret = BO_MAP(nv->screen, buf->bo, 0, nv->client);
|
||||
if (ret)
|
||||
return ret;
|
||||
memcpy((uint8_t *)buf->bo->map + buf->offset, buf->data, size);
|
||||
@@ -893,7 +893,7 @@ nouveau_user_buffer_upload(struct nouveau_context *nv,
|
||||
if (!nouveau_buffer_reallocate(screen, buf, NOUVEAU_BO_GART))
|
||||
return false;
|
||||
|
||||
ret = nouveau_bo_map(buf->bo, 0, nv->client);
|
||||
ret = BO_MAP(nv->screen, buf->bo, 0, nv->client);
|
||||
if (ret)
|
||||
return false;
|
||||
memcpy((uint8_t *)buf->bo->map + buf->offset + base, buf->data + base, size);
|
||||
@@ -989,7 +989,7 @@ nouveau_scratch_runout(struct nouveau_context *nv, unsigned size)
|
||||
|
||||
ret = nouveau_scratch_bo_alloc(nv, &nv->scratch.runout->bo[n], size);
|
||||
if (!ret) {
|
||||
ret = nouveau_bo_map(nv->scratch.runout->bo[n], 0, NULL);
|
||||
ret = BO_MAP(nv->screen, nv->scratch.runout->bo[n], 0, NULL);
|
||||
if (ret)
|
||||
nouveau_bo_ref(NULL, &nv->scratch.runout->bo[--nv->scratch.runout->nr]);
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ nouveau_scratch_next(struct nouveau_context *nv, unsigned size)
|
||||
nv->scratch.offset = 0;
|
||||
nv->scratch.end = nv->scratch.bo_size;
|
||||
|
||||
ret = nouveau_bo_map(bo, NOUVEAU_BO_WR, nv->client);
|
||||
ret = BO_MAP(nv->screen, bo, NOUVEAU_BO_WR, nv->client);
|
||||
if (!ret)
|
||||
nv->scratch.map = bo->map;
|
||||
return !ret;
|
||||
|
||||
@@ -37,12 +37,12 @@ nouveau_vpe_init(struct nouveau_decoder *dec) {
|
||||
int ret;
|
||||
if (dec->cmds)
|
||||
return 0;
|
||||
ret = nouveau_bo_map(dec->cmd_bo, NOUVEAU_BO_RDWR, dec->client);
|
||||
ret = BO_MAP(dec->screen, dec->cmd_bo, NOUVEAU_BO_RDWR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("Mapping cmd bo: %s\n", strerror(-ret));
|
||||
return ret;
|
||||
}
|
||||
ret = nouveau_bo_map(dec->data_bo, NOUVEAU_BO_RDWR, dec->client);
|
||||
ret = BO_MAP(dec->screen, dec->data_bo, NOUVEAU_BO_RDWR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("Mapping data bo: %s\n", strerror(-ret));
|
||||
return ret;
|
||||
@@ -582,7 +582,7 @@ nouveau_create_decoder(struct pipe_context *context,
|
||||
0, 4096, NULL, &dec->fence_bo);
|
||||
if (ret)
|
||||
goto fail;
|
||||
nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, NULL);
|
||||
BO_MAP(screen, dec->fence_bo, NOUVEAU_BO_RDWR, NULL);
|
||||
dec->fence_map = dec->fence_bo->map;
|
||||
dec->fence_map[0] = 0;
|
||||
#endif
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <nvif/class.h>
|
||||
|
||||
#include "nouveau_winsys.h"
|
||||
#include "nouveau_screen.h"
|
||||
#include "nouveau_context.h"
|
||||
#include "nouveau_vp3_video.h"
|
||||
@@ -284,13 +285,14 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec,
|
||||
char path[PATH_MAX];
|
||||
ssize_t r;
|
||||
uint32_t *end, endval;
|
||||
struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
|
||||
|
||||
if (chipset >= 0xa3 && chipset != 0xaa && chipset != 0xac)
|
||||
vp4_getpath(profile, path);
|
||||
else
|
||||
vp3_getpath(profile, path);
|
||||
|
||||
if (nouveau_bo_map(dec->fw_bo, NOUVEAU_BO_WR, dec->client))
|
||||
if (BO_MAP(screen, dec->fw_bo, NOUVEAU_BO_WR, dec->client))
|
||||
return 1;
|
||||
|
||||
fd = open(path, O_RDONLY | O_CLOEXEC);
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "drm-uapi/drm.h"
|
||||
#include <nouveau.h>
|
||||
|
||||
#include "nouveau_screen.h"
|
||||
|
||||
#ifndef NV04_PFIFO_MAX_PACKET_LEN
|
||||
#define NV04_PFIFO_MAX_PACKET_LEN 2047
|
||||
#endif
|
||||
@@ -67,6 +69,11 @@ PUSH_KICK(struct nouveau_pushbuf *push)
|
||||
nouveau_pushbuf_kick(push, push->channel);
|
||||
}
|
||||
|
||||
static inline int
|
||||
BO_MAP(struct nouveau_screen *screen, struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client)
|
||||
{
|
||||
return nouveau_bo_map(bo, access, client);
|
||||
}
|
||||
|
||||
#define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
|
||||
#define NOUVEAU_RESOURCE_FLAG_DRV_PRIV (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
|
||||
|
||||
@@ -359,7 +359,7 @@ nv30_miptree_transfer_map(struct pipe_context *pipe, struct pipe_resource *pt,
|
||||
if (usage & PIPE_MAP_WRITE)
|
||||
access |= NOUVEAU_BO_WR;
|
||||
|
||||
ret = nouveau_bo_map(tx->tmp.bo, access, nv30->base.client);
|
||||
ret = BO_MAP(nv30->base.screen, tx->tmp.bo, access, nv30->base.client);
|
||||
if (ret) {
|
||||
pipe_resource_reference(&tx->base.resource, NULL);
|
||||
FREE(tx);
|
||||
|
||||
@@ -732,7 +732,7 @@ nv30_screen_create(struct nouveau_device *dev)
|
||||
|
||||
ret = nouveau_bo_wrap(screen->base.device, fifo->notify, &screen->notify);
|
||||
if (ret == 0)
|
||||
ret = nouveau_bo_map(screen->notify, 0, screen->base.client);
|
||||
ret = BO_MAP(&screen->base, screen->notify, 0, screen->base.client);
|
||||
if (ret)
|
||||
FAIL_SCREEN_INIT("error mapping notifier memory: %d\n", ret);
|
||||
|
||||
|
||||
@@ -635,8 +635,8 @@ nv30_transfer_rect_cpu(XFER_ARGS)
|
||||
char *srcmap, *dstmap;
|
||||
int x, y;
|
||||
|
||||
nouveau_bo_map(src->bo, NOUVEAU_BO_RD, nv30->base.client);
|
||||
nouveau_bo_map(dst->bo, NOUVEAU_BO_WR, nv30->base.client);
|
||||
BO_MAP(nv30->base.screen, src->bo, NOUVEAU_BO_RD, nv30->base.client);
|
||||
BO_MAP(nv30->base.screen, dst->bo, NOUVEAU_BO_WR, nv30->base.client);
|
||||
srcmap = src->bo->map + src->offset;
|
||||
dstmap = dst->bo->map + dst->offset;
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ nv50_compute_upload_input(struct nv50_context *nv50, const uint32_t *input)
|
||||
mm = nouveau_mm_allocate(screen->base.mm_GART, size, &bo, &offset);
|
||||
assert(mm);
|
||||
|
||||
nouveau_bo_map(bo, 0, nv50->base.client);
|
||||
BO_MAP(&screen->base, bo, 0, nv50->base.client);
|
||||
memcpy(bo->map + offset, input, size);
|
||||
|
||||
nouveau_bufctx_refn(nv50->bufctx, 0, bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD);
|
||||
|
||||
@@ -63,7 +63,7 @@ nv50_hw_query_allocate(struct nv50_context *nv50, struct nv50_query *q,
|
||||
return false;
|
||||
hq->offset = hq->base_offset;
|
||||
|
||||
ret = nouveau_bo_map(hq->bo, 0, nv50->base.client);
|
||||
ret = BO_MAP(&screen->base, hq->bo, 0, nv50->base.client);
|
||||
if (ret) {
|
||||
nv50_hw_query_allocate(nv50, q, 0);
|
||||
return false;
|
||||
|
||||
@@ -1072,7 +1072,7 @@ nv50_screen_create(struct nouveau_device *dev)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
nouveau_bo_map(screen->fence.bo, 0, NULL);
|
||||
BO_MAP(&screen->base, screen->fence.bo, 0, NULL);
|
||||
screen->fence.map = screen->fence.bo->map;
|
||||
screen->base.fence.emit = nv50_screen_fence_emit;
|
||||
screen->base.fence.update = nv50_screen_fence_update;
|
||||
|
||||
@@ -453,7 +453,7 @@ nv50_miptree_transfer_map(struct pipe_context *pctx,
|
||||
if (usage & PIPE_MAP_WRITE)
|
||||
flags |= NOUVEAU_BO_WR;
|
||||
|
||||
ret = nouveau_bo_map(tx->rect[1].bo, flags, nv50->base.client);
|
||||
ret = BO_MAP(nv50->base.screen, tx->rect[1].bo, flags, nv50->base.client);
|
||||
if (ret) {
|
||||
nouveau_bo_ref(NULL, &tx->rect[1].bo);
|
||||
FREE(tx);
|
||||
|
||||
@@ -69,6 +69,7 @@ nv84_load_firmwares(struct nouveau_device *dev, struct nv84_decoder *dec,
|
||||
{
|
||||
int ret, size1, size2 = 0;
|
||||
struct nouveau_bo *fw;
|
||||
struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
|
||||
|
||||
size1 = filesize(fw1);
|
||||
if (fw2)
|
||||
@@ -81,7 +82,7 @@ nv84_load_firmwares(struct nouveau_device *dev, struct nv84_decoder *dec,
|
||||
ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, dec->vp_fw2_offset + size2, NULL, &fw);
|
||||
if (ret)
|
||||
return NULL;
|
||||
ret = nouveau_bo_map(fw, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, fw, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
@@ -406,14 +407,14 @@ nv84_create_decoder(struct pipe_context *context,
|
||||
NULL, &dec->bitstream);
|
||||
if (ret)
|
||||
goto fail;
|
||||
ret = nouveau_bo_map(dec->bitstream, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, dec->bitstream, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret)
|
||||
goto fail;
|
||||
ret = nouveau_bo_new(screen->device, NOUVEAU_BO_GART,
|
||||
0, 0x2000, NULL, &dec->vp_params);
|
||||
if (ret)
|
||||
goto fail;
|
||||
ret = nouveau_bo_map(dec->vp_params, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, dec->vp_params, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret)
|
||||
goto fail;
|
||||
}
|
||||
@@ -425,7 +426,7 @@ nv84_create_decoder(struct pipe_context *context,
|
||||
NULL, &dec->mpeg12_bo);
|
||||
if (ret)
|
||||
goto fail;
|
||||
ret = nouveau_bo_map(dec->mpeg12_bo, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, dec->mpeg12_bo, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret)
|
||||
goto fail;
|
||||
}
|
||||
@@ -434,7 +435,7 @@ nv84_create_decoder(struct pipe_context *context,
|
||||
0, 0x1000, NULL, &dec->fence);
|
||||
if (ret)
|
||||
goto fail;
|
||||
ret = nouveau_bo_map(dec->fence, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, dec->fence, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret)
|
||||
goto fail;
|
||||
*(uint32_t *)dec->fence->map = 0;
|
||||
|
||||
@@ -269,7 +269,7 @@ nv98_create_decoder(struct pipe_context *context,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
|
||||
BO_MAP(screen, dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
|
||||
dec->fence_map = dec->fence_bo->map;
|
||||
dec->fence_map[0] = dec->fence_map[4] = dec->fence_map[8] = 0;
|
||||
dec->comm = (struct comm *)(dec->fence_map + (COMM_OFFSET/sizeof(*dec->fence_map)));
|
||||
|
||||
@@ -39,6 +39,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
|
||||
unsigned *vp_caps, unsigned *is_ref,
|
||||
struct nouveau_vp3_video_buffer *refs[16])
|
||||
{
|
||||
struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
|
||||
struct nouveau_pushbuf *push = dec->pushbuf[0];
|
||||
enum pipe_video_format codec = u_reduce_video_profile(dec->base.profile);
|
||||
uint32_t bsp_addr, comm_addr, inter_addr;
|
||||
@@ -95,7 +96,7 @@ nv98_decoder_bsp(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
|
||||
bo_refs[1].bo = dec->inter_bo[comm_seq & 1] = inter_bo = tmp_bo;
|
||||
}
|
||||
|
||||
ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, bsp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("map failed: %i %s\n", ret, strerror(-ret));
|
||||
return -1;
|
||||
|
||||
@@ -44,7 +44,8 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
|
||||
|
||||
if ((comm->pvp_stage & 0xff) != 0xff) {
|
||||
unsigned *map;
|
||||
int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
|
||||
int ret = BO_MAP(nouveau_screen(dec->base.context->screen), inter_bo,
|
||||
NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
|
||||
assert(ret >= 0);
|
||||
map = inter_bo->map;
|
||||
for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
|
||||
|
||||
@@ -55,7 +55,7 @@ nvc0_hw_query_allocate(struct nvc0_context *nvc0, struct nvc0_query *q,
|
||||
return false;
|
||||
hq->offset = hq->base_offset;
|
||||
|
||||
ret = nouveau_bo_map(hq->bo, 0, nvc0->base.client);
|
||||
ret = BO_MAP(&screen->base, hq->bo, 0, nvc0->base.client);
|
||||
if (ret) {
|
||||
nvc0_hw_query_allocate(nvc0, q, 0);
|
||||
return false;
|
||||
|
||||
@@ -1124,7 +1124,7 @@ nvc0_screen_create(struct nouveau_device *dev)
|
||||
ret = nouveau_bo_new(dev, flags, 0, 4096, NULL, &screen->fence.bo);
|
||||
if (ret)
|
||||
FAIL_SCREEN_INIT("Error allocating fence BO: %d\n", ret);
|
||||
nouveau_bo_map(screen->fence.bo, 0, NULL);
|
||||
BO_MAP(&screen->base, screen->fence.bo, 0, NULL);
|
||||
screen->fence.map = screen->fence.bo->map;
|
||||
screen->base.fence.emit = nvc0_screen_fence_emit;
|
||||
screen->base.fence.update = nvc0_screen_fence_update;
|
||||
|
||||
@@ -388,7 +388,7 @@ nvc0_miptree_transfer_map(struct pipe_context *pctx,
|
||||
if (nvc0_mt_transfer_can_map_directly(mt)) {
|
||||
ret = !nvc0_mt_sync(nvc0, mt, usage);
|
||||
if (!ret)
|
||||
ret = nouveau_bo_map(mt->base.bo, 0, NULL);
|
||||
ret = BO_MAP(nvc0->base.screen, mt->base.bo, 0, NULL);
|
||||
if (ret &&
|
||||
(usage & PIPE_MAP_DIRECTLY))
|
||||
return NULL;
|
||||
@@ -480,7 +480,7 @@ nvc0_miptree_transfer_map(struct pipe_context *pctx,
|
||||
if (usage & PIPE_MAP_WRITE)
|
||||
flags |= NOUVEAU_BO_WR;
|
||||
|
||||
ret = nouveau_bo_map(tx->rect[1].bo, flags, nvc0->base.client);
|
||||
ret = BO_MAP(nvc0->base.screen, tx->rect[1].bo, flags, nvc0->base.client);
|
||||
if (ret) {
|
||||
pipe_resource_reference(&tx->base.resource, NULL);
|
||||
nouveau_bo_ref(NULL, &tx->rect[1].bo);
|
||||
|
||||
@@ -293,7 +293,7 @@ nvc0_create_decoder(struct pipe_context *context,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
nouveau_bo_map(dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
|
||||
BO_MAP(screen, dec->fence_bo, NOUVEAU_BO_RDWR, screen->client);
|
||||
dec->fence_map = dec->fence_bo->map;
|
||||
dec->fence_map[0] = dec->fence_map[4] = dec->fence_map[8] = 0;
|
||||
dec->comm = (struct comm *)(dec->fence_map + (COMM_OFFSET/sizeof(*dec->fence_map)));
|
||||
|
||||
@@ -34,10 +34,11 @@ static void dump_comm_bsp(struct comm *comm)
|
||||
unsigned
|
||||
nvc0_decoder_bsp_begin(struct nouveau_vp3_decoder *dec, unsigned comm_seq)
|
||||
{
|
||||
struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
|
||||
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
|
||||
unsigned ret = 0;
|
||||
|
||||
ret = nouveau_bo_map(bsp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, bsp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("map failed: %i %s\n", ret, strerror(-ret));
|
||||
return -1;
|
||||
@@ -53,6 +54,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3_decoder *dec,
|
||||
unsigned comm_seq, unsigned num_buffers,
|
||||
const void *const *data, const unsigned *num_bytes)
|
||||
{
|
||||
struct nouveau_screen *screen = nouveau_screen(dec->base.context->screen);
|
||||
struct nouveau_bo *bsp_bo = dec->bsp_bo[comm_seq % NOUVEAU_VP3_VIDEO_QDEPTH];
|
||||
struct nouveau_bo *inter_bo = dec->inter_bo[comm_seq & 1];
|
||||
uint32_t bsp_size = 0;
|
||||
@@ -82,7 +84,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3_decoder *dec,
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = nouveau_bo_map(tmp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, tmp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("map failed: %i %s\n", ret, strerror(-ret));
|
||||
return -1;
|
||||
@@ -114,7 +116,7 @@ nvc0_decoder_bsp_next(struct nouveau_vp3_decoder *dec,
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = nouveau_bo_map(tmp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
ret = BO_MAP(screen, tmp_bo, NOUVEAU_BO_WR, dec->client);
|
||||
if (ret) {
|
||||
debug_printf("map failed: %i %s\n", ret, strerror(-ret));
|
||||
return -1;
|
||||
|
||||
@@ -44,7 +44,8 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
|
||||
|
||||
if ((comm->pvp_stage & 0xff) != 0xff) {
|
||||
unsigned *map;
|
||||
int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
|
||||
int ret = BO_MAP(nouveau_screen(dec->base.context->screen), inter_bo,
|
||||
NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
|
||||
assert(ret >= 0);
|
||||
map = inter_bo->map;
|
||||
for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
|
||||
|
||||
@@ -1031,7 +1031,7 @@ nve4_compute_trap_info(struct nvc0_context *nvc0)
|
||||
volatile struct nve4_mp_trap_info *info;
|
||||
uint8_t *map;
|
||||
|
||||
ret = nouveau_bo_map(bo, NOUVEAU_BO_RDWR, nvc0->base.client);
|
||||
ret = BO_MAP(&screen->base, bo, NOUVEAU_BO_RDWR, nvc0->base.client);
|
||||
if (ret)
|
||||
return;
|
||||
map = (uint8_t *)bo->map;
|
||||
|
||||
Reference in New Issue
Block a user