diff options
author | Thomas Hellström <thomas@shipmail.org> | 2009-01-17 17:30:05 +0000 |
---|---|---|
committer | Thomas Hellström <thomas@shipmail.org> | 2009-01-17 17:30:05 +0000 |
commit | d7da637c8f7447ba40ea437356dac59267accbe5 (patch) | |
tree | 59ca414c1def66d294a30de3da2236a7ca7d53fc | |
parent | cc33cd1de76edead93cef1e57c26031e134878f0 (diff) |
Update for new via drm interface.
-rw-r--r-- | libxvmc/ochr_ioctl.c | 94 | ||||
-rw-r--r-- | libxvmc/ochr_ws_driver.h | 4 | ||||
-rw-r--r-- | libxvmc/viaLowLevelPro.c | 2 | ||||
-rw-r--r-- | src/ochr_ioctl.c | 134 | ||||
-rw-r--r-- | src/ochr_ws_driver.h | 4 | ||||
-rw-r--r-- | src/via_driver.c | 2 | ||||
-rw-r--r-- | src/via_drmclient.h | 4 | ||||
-rw-r--r-- | src/via_xvmc.c | 2 |
8 files changed, 126 insertions, 120 deletions
diff --git a/libxvmc/ochr_ioctl.c b/libxvmc/ochr_ioctl.c index e029d0a..d8b77fb 100644 --- a/libxvmc/ochr_ioctl.c +++ b/libxvmc/ochr_ioctl.c @@ -6,11 +6,11 @@ struct via_reloc_bufinfo { - struct via_reloc_header *first_header; - struct via_reloc_header *cur_header; - struct via_reloc_header *save_first_header; - struct via_reloc_header *save_cur_header; - struct via_reloc_header save_old_header; + struct drm_via_reloc_header *first_header; + struct drm_via_reloc_header *cur_header; + struct drm_via_reloc_header *save_first_header; + struct drm_via_reloc_header *save_cur_header; + struct drm_via_reloc_header save_old_header; }; /* @@ -30,12 +30,12 @@ ochr_reloc_state_save(struct via_reloc_bufinfo *info) */ static void -ochr_free_reloc_header(struct via_reloc_header *header) +ochr_free_reloc_header(struct drm_via_reloc_header *header) { - struct via_reloc_header *new_header; + struct drm_via_reloc_header *new_header; while (header) { - new_header = (struct via_reloc_header *)(unsigned long) + new_header = (struct drm_via_reloc_header *)(unsigned long) header->next_header; free(header); header = new_header; @@ -48,11 +48,11 @@ ochr_free_reloc_header(struct via_reloc_header *header) void ochr_reloc_state_restore(struct via_reloc_bufinfo *info) { - struct via_reloc_header *added_chain; + struct drm_via_reloc_header *added_chain; assert(info->save_old_header.next_header == 0ULL); - added_chain = (struct via_reloc_header *)(unsigned long) + added_chain = (struct drm_via_reloc_header *)(unsigned long) info->cur_header->next_header; if (added_chain) @@ -68,7 +68,7 @@ ochr_reloc_state_restore(struct via_reloc_bufinfo *info) static int ochr_add_reloc_buffer(struct via_reloc_bufinfo *info) { - struct via_reloc_header *header; + struct drm_via_reloc_header *header; header = malloc(VIA_RELOC_BUF_SIZE); @@ -91,7 +91,7 @@ ochr_add_reloc_buffer(struct via_reloc_bufinfo *info) static int ochr_reset_reloc_buffer(struct via_reloc_bufinfo *info) { - struct via_reloc_header *header; + struct drm_via_reloc_header *header; if (info->first_header == NULL) { header = info->first_header = malloc(VIA_RELOC_BUF_SIZE); @@ -99,7 +99,7 @@ ochr_reset_reloc_buffer(struct via_reloc_bufinfo *info) return -ENOMEM; } else { header = info->first_header; - ochr_free_reloc_header((struct via_reloc_header *)(unsigned long) + ochr_free_reloc_header((struct drm_via_reloc_header *)(unsigned long) header->next_header); } header->next_header = 0ULL; @@ -145,7 +145,7 @@ ochr_free_reloc_buffer(struct via_reloc_bufinfo *info) static int ochr_add_reloc(struct via_reloc_bufinfo *info, void *reloc, size_t size) { - struct via_reloc_header *header = info->cur_header; + struct drm_via_reloc_header *header = info->cur_header; if (header->used + size > VIA_RELOC_BUF_SIZE) { int ret; @@ -188,10 +188,10 @@ static int ochr_apply_yuv_reloc(uint32_t *cmdbuf, uint32_t num_buffers, struct via_validate_buffer *buffers, - const struct via_yuv_reloc *reloc) + const struct drm_via_yuv_reloc *reloc) { uint32_t *buf = cmdbuf + reloc->base.offset; - const struct via_reloc_bufaddr *baddr = &reloc->addr; + const struct drm_via_reloc_bufaddr *baddr = &reloc->addr; const struct via_validate_buffer *val_buf; uint32_t val; int i; @@ -225,11 +225,11 @@ ochr_yuv_relocation(struct ochr_cmd_buffer *c_buf, uint32_t shift, uint64_t flags, uint64_t mask) { - struct via_yuv_reloc reloc; + struct drm_via_yuv_reloc reloc; struct via_validate_buffer fake; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; uint32_t *cmdbuf = (uint32_t *) c_buf->buf + (c_buf->pos - planes * 2); @@ -242,7 +242,7 @@ ochr_yuv_relocation(struct ochr_cmd_buffer *c_buf, val_req = ochrValReq(node); if (!(val_req->presumed_flags & VIA_USE_PRESUMED)) { - val_req->presumed_gpu_offset = (uint64_t) wsbmBOOffset(buffer) - + val_req->presumed_gpu_offset = (uint64_t) wsbmBOOffsetHint(buffer) - wsbmBOPoolOffset(buffer); val_req->presumed_flags |= VIA_USE_PRESUMED; } @@ -276,10 +276,10 @@ static int ochr_apply_2d_reloc(uint32_t * cmdbuf, uint32_t num_buffers, const struct via_validate_buffer *buffers, - const struct via_2d_reloc *reloc) + const struct drm_via_2d_reloc *reloc) { - uint32_t *buf = cmdbuf + reloc->offset; - const struct via_reloc_bufaddr *baddr = &reloc->addr; + uint32_t *buf = cmdbuf + reloc->base.offset; + const struct drm_via_reloc_bufaddr *baddr = &reloc->addr; const struct via_validate_buffer *val_buf; uint32_t val; uint32_t x; @@ -312,11 +312,11 @@ ochr_2d_relocation(struct ochr_cmd_buffer *c_buf, uint32_t delta, uint32_t bpp, uint32_t pos, uint64_t flags, uint64_t mask) { - struct via_2d_reloc reloc; + struct drm_via_2d_reloc reloc; struct via_validate_buffer fake; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; uint32_t *cmdbuf = (uint32_t *) c_buf->buf + (c_buf->pos - 4); @@ -329,14 +329,14 @@ ochr_2d_relocation(struct ochr_cmd_buffer *c_buf, val_req = ochrValReq(node); if (!(val_req->presumed_flags & VIA_USE_PRESUMED)) { - val_req->presumed_gpu_offset = (uint64_t) wsbmBOOffset(buffer); + val_req->presumed_gpu_offset = (uint64_t) wsbmBOOffsetHint(buffer); val_req->presumed_flags |= VIA_USE_PRESUMED; } fake.po_correct = 0; fake.offset = val_req->presumed_gpu_offset; - reloc.type = VIA_RELOC_2D; - reloc.offset = 1; + reloc.base.type = VIA_RELOC_2D; + reloc.base.offset = 1; reloc.addr.index = 0; reloc.addr.delta = delta; reloc.bpp = bpp; @@ -347,7 +347,7 @@ ochr_2d_relocation(struct ochr_cmd_buffer *c_buf, ret = ochr_apply_2d_reloc(cmdbuf, 1, &fake, &reloc); reloc.addr.index = itemLoc; - reloc.offset = tmp + 1; + reloc.base.offset = tmp + 1; assert(ret == 0); @@ -357,14 +357,14 @@ ochr_2d_relocation(struct ochr_cmd_buffer *c_buf, int ochr_execbuf(int fd, struct ochr_cmd_buffer *c_buf) { - union via_ttm_execbuf_arg arg; - struct via_ttm_execbuf_req *exec_req = &arg.req; + struct drm_via_ttm_execbuf_arg arg; + struct drm_via_ttm_execbuf_control control; struct _ValidateList *valList; struct _ValidateNode *node; struct _ViaDrmValidateNode *viaNode; - struct via_validate_arg *val_arg; - struct via_validate_req *req; - struct via_validate_rep *rep; + struct drm_via_validate_arg *val_arg; + struct drm_via_validate_req *req; + struct drm_via_validate_rep *rep; uint64_t first = 0ULL; uint64_t *prevNext = NULL; @@ -396,7 +396,6 @@ ochr_execbuf(int fd, struct ochr_cmd_buffer *c_buf) req->buffer_handle = wsbmKBufHandle((struct _WsbmKernelBuf *) node->buf); - req->group = 0; req->set_flags = node->set_flags; req->clear_flags = node->clr_flags; @@ -404,33 +403,38 @@ ochr_execbuf(int fd, struct ochr_cmd_buffer *c_buf) ++count; } + + memset(&control, 0, sizeof(control)); + /* * Fill in the execbuf arg itself. */ - exec_req->buffer_list = first; - exec_req->num_buffers = count; - exec_req->reloc_list = (uint64_t) (unsigned long) + arg.buffer_list = first; + arg.num_buffers = count; + arg.reloc_list = (uint64_t) (unsigned long) c_buf->reloc_info->first_header; - exec_req->cmd_buffer = (uint64_t) (unsigned long) + arg.cmd_buffer = (uint64_t) (unsigned long) c_buf->buf; - exec_req->cmd_buffer_size = c_buf->pos << 2; + arg.control = (uint64_t) (unsigned long) &control; + + arg.cmd_buffer_size = c_buf->pos << 2; /* * FIXME: Use AGP when we've resolved the locks that happen * when we run 3D DRI clients and X server AGP command submission. */ - /* exec_req->mechanism = (c_buf->needsPCI) ? + /* arg.mechanism = (c_buf->needsPCI) ? _VIA_MECHANISM_PCI : _VIA_MECHANISM_AGP; */ - exec_req->mechanism = (c_buf->needs_pci) ? _VIA_MECHANISM_PCI : + arg.mechanism = (c_buf->needs_pci) ? _VIA_MECHANISM_PCI : _VIA_MECHANISM_AGP; - exec_req->exec_flags = DRM_VIA_FENCE_NO_USER | c_buf->exec_flags; - exec_req->cliprect_offset = 0; - exec_req->num_cliprects = 0; + arg.exec_flags = DRM_VIA_FENCE_NO_USER | c_buf->exec_flags; + arg.cliprect_offset = 0; + arg.num_cliprects = 0; do { - ret = drmCommandWriteRead(fd, DRM_VIA_TTM_EXECBUF, &arg, sizeof(arg)); + ret = drmCommandWrite(fd, DRM_VIA_TTM_EXECBUF, &arg, sizeof(arg)); } while (ret == -EAGAIN || ret == -EINTR); diff --git a/libxvmc/ochr_ws_driver.h b/libxvmc/ochr_ws_driver.h index 214859c..1844f5b 100644 --- a/libxvmc/ochr_ws_driver.h +++ b/libxvmc/ochr_ws_driver.h @@ -8,12 +8,12 @@ struct _ViaDrmValidateNode { struct _ValidateNode base; - struct via_validate_arg val_arg; + struct drm_via_validate_arg val_arg; }; extern struct _WsbmVNodeFuncs *ochrVNodeFuncs(void); -static inline struct via_validate_req * +static inline struct drm_via_validate_req * ochrValReq(struct _ValidateNode *node) { return &(containerOf(node, struct _ViaDrmValidateNode, base)-> diff --git a/libxvmc/viaLowLevelPro.c b/libxvmc/viaLowLevelPro.c index 23b3740..42d407c 100644 --- a/libxvmc/viaLowLevelPro.c +++ b/libxvmc/viaLowLevelPro.c @@ -958,7 +958,7 @@ viaCmdBufferInit(struct _ViaCommandBuffer *buf, if (!buf->c_buf.reloc_info) goto out_err0; - buf->c_buf.validate_list = wsbmBOCreateList(10); + buf->c_buf.validate_list = wsbmBOCreateList(10, 1); if (!buf->c_buf.validate_list) goto out_err1; diff --git a/src/ochr_ioctl.c b/src/ochr_ioctl.c index 3a4403e..79a7b70 100644 --- a/src/ochr_ioctl.c +++ b/src/ochr_ioctl.c @@ -6,11 +6,11 @@ struct via_reloc_bufinfo { - struct via_reloc_header *first_header; - struct via_reloc_header *cur_header; - struct via_reloc_header *save_first_header; - struct via_reloc_header *save_cur_header; - struct via_reloc_header save_old_header; + struct drm_via_reloc_header *first_header; + struct drm_via_reloc_header *cur_header; + struct drm_via_reloc_header *save_first_header; + struct drm_via_reloc_header *save_cur_header; + struct drm_via_reloc_header save_old_header; }; /* @@ -30,12 +30,12 @@ ochr_reloc_state_save(struct via_reloc_bufinfo *info) */ static void -ochr_free_reloc_header(struct via_reloc_header *header) +ochr_free_reloc_header(struct drm_via_reloc_header *header) { - struct via_reloc_header *new_header; + struct drm_via_reloc_header *new_header; while (header) { - new_header = (struct via_reloc_header *)(unsigned long) + new_header = (struct drm_via_reloc_header *)(unsigned long) header->next_header; free(header); header = new_header; @@ -48,11 +48,11 @@ ochr_free_reloc_header(struct via_reloc_header *header) void ochr_reloc_state_restore(struct via_reloc_bufinfo *info) { - struct via_reloc_header *added_chain; + struct drm_via_reloc_header *added_chain; assert(info->save_old_header.next_header == 0ULL); - added_chain = (struct via_reloc_header *)(unsigned long) + added_chain = (struct drm_via_reloc_header *)(unsigned long) info->cur_header->next_header; if (added_chain) @@ -68,7 +68,7 @@ ochr_reloc_state_restore(struct via_reloc_bufinfo *info) static int ochr_add_reloc_buffer(struct via_reloc_bufinfo *info) { - struct via_reloc_header *header; + struct drm_via_reloc_header *header; header = malloc(VIA_RELOC_BUF_SIZE); @@ -91,7 +91,7 @@ ochr_add_reloc_buffer(struct via_reloc_bufinfo *info) static int ochr_reset_reloc_buffer(struct via_reloc_bufinfo *info) { - struct via_reloc_header *header; + struct drm_via_reloc_header *header; if (info->first_header == NULL) { header = info->first_header = malloc(VIA_RELOC_BUF_SIZE); @@ -99,7 +99,7 @@ ochr_reset_reloc_buffer(struct via_reloc_bufinfo *info) return -ENOMEM; } else { header = info->first_header; - ochr_free_reloc_header((struct via_reloc_header *)(unsigned long) + ochr_free_reloc_header((struct drm_via_reloc_header *)(unsigned long) header->next_header); } header->next_header = 0ULL; @@ -145,7 +145,7 @@ ochr_free_reloc_buffer(struct via_reloc_bufinfo *info) static int ochr_add_reloc(struct via_reloc_bufinfo *info, void *reloc, size_t size) { - struct via_reloc_header *header = info->cur_header; + struct drm_via_reloc_header *header = info->cur_header; if (header->used + size > VIA_RELOC_BUF_SIZE) { int ret; @@ -188,10 +188,10 @@ static int ochr_apply_yuv_reloc(uint32_t *cmdbuf, uint32_t num_buffers, struct via_validate_buffer *buffers, - const struct via_yuv_reloc *reloc) + const struct drm_via_yuv_reloc *reloc) { uint32_t *buf = cmdbuf + reloc->base.offset; - const struct via_reloc_bufaddr *baddr = &reloc->addr; + const struct drm_via_reloc_bufaddr *baddr = &reloc->addr; const struct via_validate_buffer *val_buf; uint32_t val; int i; @@ -225,11 +225,11 @@ ochr_yuv_relocation(struct _ViaCommandBuffer *cBuf, uint32_t shift, uint64_t flags, uint64_t mask) { - struct via_yuv_reloc reloc; + struct drm_via_yuv_reloc reloc; struct via_validate_buffer fake; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; uint32_t *cmdbuf = (uint32_t *) cBuf->buf + (cBuf->pos - planes * 2); @@ -276,10 +276,10 @@ static int ochr_apply_2d_reloc(uint32_t * cmdbuf, uint32_t num_buffers, const struct via_validate_buffer *buffers, - const struct via_2d_reloc *reloc) + const struct drm_via_2d_reloc *reloc) { - uint32_t *buf = cmdbuf + reloc->offset; - const struct via_reloc_bufaddr *baddr = &reloc->addr; + uint32_t *buf = cmdbuf + reloc->base.offset; + const struct drm_via_reloc_bufaddr *baddr = &reloc->addr; const struct via_validate_buffer *val_buf; uint32_t val; uint32_t x; @@ -312,11 +312,11 @@ ochr_2d_relocation(struct _ViaCommandBuffer *cBuf, uint32_t delta, uint32_t bpp, uint32_t pos, uint64_t flags, uint64_t mask) { - struct via_2d_reloc reloc; + struct drm_via_2d_reloc reloc; struct via_validate_buffer fake; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; uint32_t *cmdbuf = (uint32_t *) cBuf->buf + (cBuf->pos - 4); @@ -335,8 +335,8 @@ ochr_2d_relocation(struct _ViaCommandBuffer *cBuf, fake.po_correct = 0; fake.offset = val_req->presumed_gpu_offset; - reloc.type = VIA_RELOC_2D; - reloc.offset = 1; + reloc.base.type = VIA_RELOC_2D; + reloc.base.offset = 1; reloc.addr.index = 0; reloc.addr.delta = delta; reloc.bpp = bpp; @@ -347,7 +347,7 @@ ochr_2d_relocation(struct _ViaCommandBuffer *cBuf, ret = ochr_apply_2d_reloc(cmdbuf, 1, &fake, &reloc); reloc.addr.index = itemLoc; - reloc.offset = tmp + 1; + reloc.base.offset = tmp + 1; assert(ret == 0); @@ -358,11 +358,11 @@ static int ochr_apply_texture_reloc(uint32_t ** cmdbuf, uint32_t num_buffers, struct via_validate_buffer *buffers, - const struct via_texture_reloc *reloc) + const struct drm_via_texture_reloc *reloc) { - const struct via_reloc_bufaddr *baddr = reloc->addr; + const struct drm_via_reloc_bufaddr *baddr = reloc->addr; uint32_t baseh[4]; - uint32_t *buf = *cmdbuf + reloc->offset; + uint32_t *buf = *cmdbuf + reloc->base.offset; uint32_t val; int i; int basereg; @@ -421,13 +421,13 @@ ochr_tex_relocation(struct _ViaCommandBuffer *cBuf, uint32_t hi_mip, uint32_t reg_tex_fm, uint64_t flags, uint64_t mask) { - struct via_texture_reloc reloc; + struct drm_via_texture_reloc reloc; struct via_validate_buffer fake[12]; - struct via_reloc_bufaddr fake_addr[12]; - struct via_reloc_bufaddr real_addr[12]; + struct drm_via_reloc_bufaddr fake_addr[12]; + struct drm_via_reloc_bufaddr real_addr[12]; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; int i; @@ -466,23 +466,23 @@ ochr_tex_relocation(struct _ViaCommandBuffer *cBuf, } wsbmReadUnlockKernelBO(); - reloc.type = VIA_RELOC_TEX; - reloc.offset = 0; + reloc.base.type = VIA_RELOC_TEX; + reloc.base.offset = 0; reloc.low_mip = low_mip; reloc.hi_mip = hi_mip; reloc.reg_tex_fm = reg_tex_fm; - memcpy(reloc.addr, fake_addr, count * sizeof(struct via_reloc_bufaddr)); + memcpy(reloc.addr, fake_addr, count * sizeof(struct drm_via_reloc_bufaddr)); tmp = cBuf->pos; ret = ochr_apply_texture_reloc(&cmdBuf, count, fake, &reloc); cBuf->pos = cmdBuf - (uint32_t *) cBuf->buf; - memcpy(reloc.addr, real_addr, count * sizeof(struct via_reloc_bufaddr)); - reloc.offset = tmp; + memcpy(reloc.addr, real_addr, count * sizeof(struct drm_via_reloc_bufaddr)); + reloc.base.offset = tmp; - size = offsetof(struct via_texture_reloc, addr) - - offsetof(struct via_texture_reloc, type) + - count * sizeof(struct via_reloc_bufaddr); + size = offsetof(struct drm_via_texture_reloc, addr) - + offsetof(struct drm_via_texture_reloc, base) + + count * sizeof(struct drm_via_reloc_bufaddr); assert(ret == 0); @@ -493,10 +493,10 @@ static int ochr_apply_dest_reloc(uint32_t ** cmdbuf, uint32_t num_buffers, struct via_validate_buffer *buffers, - const struct via_zbuf_reloc *reloc) + const struct drm_via_zbuf_reloc *reloc) { - uint32_t *buf = *cmdbuf + reloc->offset; - const struct via_reloc_bufaddr *baddr = &reloc->addr; + uint32_t *buf = *cmdbuf + reloc->base.offset; + const struct drm_via_reloc_bufaddr *baddr = &reloc->addr; const struct via_validate_buffer *val_buf; uint32_t val; @@ -520,11 +520,11 @@ ochr_dest_relocation(struct _ViaCommandBuffer *cBuf, struct _WsbmBufferObject *dstBuffer, uint32_t delta, uint64_t flags, uint64_t mask) { - struct via_zbuf_reloc reloc; + struct drm_via_zbuf_reloc reloc; struct via_validate_buffer fake; int itemLoc; struct _ValidateNode *node; - struct via_validate_req *val_req; + struct drm_via_validate_req *val_req; int ret; uint32_t tmp; uint32_t *cmdbuf = (uint32_t *) cBuf->buf + cBuf->pos; @@ -546,8 +546,8 @@ ochr_dest_relocation(struct _ViaCommandBuffer *cBuf, fake.po_correct = 0; fake.offset = val_req->presumed_gpu_offset; - reloc.type = VIA_RELOC_DSTBUF; - reloc.offset = 0; + reloc.base.type = VIA_RELOC_DSTBUF; + reloc.base.offset = 0; reloc.addr.index = 0; reloc.addr.delta = delta; @@ -555,7 +555,7 @@ ochr_dest_relocation(struct _ViaCommandBuffer *cBuf, (void)ochr_apply_dest_reloc(&cmdbuf, 1, &fake, &reloc); reloc.addr.index = itemLoc; - reloc.offset = tmp; + reloc.base.offset = tmp; cBuf->pos = cmdbuf - (uint32_t *) cBuf->buf; return ochr_add_reloc(cBuf->reloc_info, &reloc, sizeof(reloc)); @@ -564,14 +564,14 @@ ochr_dest_relocation(struct _ViaCommandBuffer *cBuf, int ochr_execbuf(int fd, struct _ViaCommandBuffer *cBuf) { - union via_ttm_execbuf_arg arg; - struct via_ttm_execbuf_req *exec_req = &arg.req; + struct drm_via_ttm_execbuf_arg arg; + struct drm_via_ttm_execbuf_control control; struct _ValidateList *valList; struct _ValidateNode *node; struct _ViaDrmValidateNode *viaNode; - struct via_validate_arg *val_arg; - struct via_validate_req *req; - struct via_validate_rep *rep; + struct drm_via_validate_arg *val_arg; + struct drm_via_validate_req *req; + struct drm_via_validate_rep *rep; uint64_t first = 0ULL; uint64_t *prevNext = NULL; @@ -603,7 +603,6 @@ ochr_execbuf(int fd, struct _ViaCommandBuffer *cBuf) req->buffer_handle = wsbmKBufHandle((struct _WsbmKernelBuf *) node->buf); - req->group = 0; req->set_flags = node->set_flags; req->clear_flags = node->clr_flags; @@ -615,22 +614,25 @@ ochr_execbuf(int fd, struct _ViaCommandBuffer *cBuf) * Fill in the execbuf arg itself. */ - exec_req->buffer_list = first; - exec_req->num_buffers = count; - exec_req->reloc_list = (uint64_t) (unsigned long) + memset(&control, 0, sizeof(control)); + + arg.buffer_list = first; + arg.num_buffers = count; + arg.reloc_list = (uint64_t) (unsigned long) cBuf->reloc_info->first_header; - exec_req->cmd_buffer = (uint64_t) (unsigned long) + arg.cmd_buffer = (uint64_t) (unsigned long) cBuf->buf; - exec_req->cmd_buffer_size = cBuf->pos << 2; - exec_req->context = DRIGetContext(cBuf->pScrn->pScreen); - exec_req->mechanism = (cBuf->needsPCI) ? _VIA_MECHANISM_PCI : + arg.control = (uint64_t) (unsigned long) &control; + arg.cmd_buffer_size = cBuf->pos << 2; + arg.context = DRIGetContext(cBuf->pScrn->pScreen); + arg.mechanism = (cBuf->needsPCI) ? _VIA_MECHANISM_PCI : _VIA_MECHANISM_AGP; - exec_req->exec_flags = DRM_VIA_FENCE_NO_USER | cBuf->execFlags; - exec_req->cliprect_offset = 0; - exec_req->num_cliprects = 0; + arg.exec_flags = DRM_VIA_FENCE_NO_USER | cBuf->execFlags; + arg.cliprect_offset = 0; + arg.num_cliprects = 0; do { - ret = drmCommandWriteRead(fd, DRM_VIA_TTM_EXECBUF, &arg, sizeof(arg)); + ret = drmCommandWrite(fd, DRM_VIA_TTM_EXECBUF, &arg, sizeof(arg)); } while (ret == -EAGAIN || ret == -EINTR || ret == -ERESTART); diff --git a/src/ochr_ws_driver.h b/src/ochr_ws_driver.h index 214859c..1844f5b 100644 --- a/src/ochr_ws_driver.h +++ b/src/ochr_ws_driver.h @@ -8,12 +8,12 @@ struct _ViaDrmValidateNode { struct _ValidateNode base; - struct via_validate_arg val_arg; + struct drm_via_validate_arg val_arg; }; extern struct _WsbmVNodeFuncs *ochrVNodeFuncs(void); -static inline struct via_validate_req * +static inline struct drm_via_validate_req * ochrValReq(struct _ValidateNode *node) { return &(containerOf(node, struct _ViaDrmValidateNode, base)-> diff --git a/src/via_driver.c b/src/via_driver.c index b16fc71..9d7bddc 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -2509,7 +2509,7 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pVia->directRenderingEnabled = VIADRIScreenInit(pScreen); pVia->vtNotified = FALSE; if (pVia->directRenderingEnabled && !pVia->IsSecondary) { - const char drm_ext[] = "via_ttm_placement_drop_080912"; + const char drm_ext[] = "via_ttm_placement_081121"; union drm_via_extension_arg arg; strncpy(arg.extension, drm_ext, sizeof(arg.extension)); ret = drmCommandWriteRead(pVia->drmFD, DRM_VIA_EXTENSION, &arg, diff --git a/src/via_drmclient.h b/src/via_drmclient.h index 751b717..38734ff 100644 --- a/src/via_drmclient.h +++ b/src/via_drmclient.h @@ -34,7 +34,7 @@ #define UNICHROME_LOCK(fd, lockNo, saPriv, context, lastcontext, ret) \ do { \ - volatile drm_hw_lock_t *lockPtr = XVMCLOCKPTR((saPriv), (lockNo)); \ + volatile drm_hw_lock_t *lockPtr = DRM_VIA_XVMCLOCKPTR((saPriv), (lockNo)); \ unsigned lockVal; \ DRM_CAS_RESULT(__ret); \ \ @@ -71,7 +71,7 @@ #define UNICHROME_UNLOCK(fd, lockNo, saPriv, context) \ do { \ - volatile drm_hw_lock_t *lockPtr = XVMCLOCKPTR((saPriv), (lockNo)); \ + volatile drm_hw_lock_t *lockPtr = DRM_VIA_XVMCLOCKPTR((saPriv), (lockNo)); \ \ if ((lockPtr->lock & ~DRM_LOCK_CONT) == \ ((context) | DRM_LOCK_HELD)) { \ diff --git a/src/via_xvmc.c b/src/via_xvmc.c index 249ee25..6b63a88 100644 --- a/src/via_xvmc.c +++ b/src/via_xvmc.c @@ -381,7 +381,7 @@ ViaInitXVMC(ScreenPtr pScreen) saPriv = (ViaXvMCSAreaPriv *) DRIGetSAREAPrivate(pScreen); saPriv->XvMCCtxNoGrabbed = ~0; - XVMCLOCKPTR(saPriv, UNICHROME_LOCK_DECODER1)->lock = 0; + DRM_VIA_XVMCLOCKPTR(saPriv, UNICHROME_LOCK_DECODER1)->lock = 0; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] Initialized XvMC extension.\n"); |