summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-02 17:00:47 -0700
committerEric Anholt <eric@anholt.net>2008-05-02 17:00:47 -0700
commitef33e76cebed39551aabce397d165d3990ba517c (patch)
treef9d099367311e8bdf14de825ccc798617375bc6f /src/mesa/drivers/dri/intel
parenteb10cdc838fc31ea2cf59f556f6f7d8b072f5bae (diff)
Minor fixups to get GEM to the point of execbuf ioctl.
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_bufmgr_gem.c19
-rw-r--r--src/mesa/drivers/dri/intel/intel_ioctl.c2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
index 07f782ca3a..a18ccd1637 100644
--- a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
+++ b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c
@@ -250,9 +250,9 @@ intel_setup_reloc_list(dri_bo *bo)
}
static dri_bo *
-dri_gem_alloc(dri_bufmgr *bufmgr, const char *name,
- unsigned long size, unsigned int alignment,
- uint64_t location_mask)
+dri_gem_bo_alloc(dri_bufmgr *bufmgr, const char *name,
+ unsigned long size, unsigned int alignment,
+ uint64_t location_mask)
{
dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)bufmgr;
dri_bo_gem *bo_gem;
@@ -336,9 +336,9 @@ dri_gem_alloc(dri_bufmgr *bufmgr, const char *name,
* working around the X Server not creating buffers and passing handles to us.
*/
static dri_bo *
-dri_gem_alloc_static(dri_bufmgr *bufmgr, const char *name,
- unsigned long offset, unsigned long size, void *virtual,
- uint64_t location_mask)
+dri_gem_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
+ unsigned long offset, unsigned long size, void *virtual,
+ uint64_t location_mask)
{
return NULL;
}
@@ -475,7 +475,10 @@ dri_gem_bo_map(dri_bo *bo, GLboolean write_enable)
if (bo_gem->virtual == NULL) {
struct drm_gem_mmap mmap_arg;
+ memset(&mmap_arg, 0, sizeof(mmap_arg));
mmap_arg.handle = bo_gem->gem_handle;
+ mmap_arg.offset = 0;
+ mmap_arg.size = bo->size;
ret = ioctl(bufmgr_gem->fd, DRM_IOCTL_GEM_MMAP, &mmap_arg);
if (ret != 0) {
fprintf(stderr, "%s:%d: Error mapping buffer %s: %s .\n",
@@ -730,8 +733,8 @@ intel_bufmgr_gem_init(int fd, int batch_size)
*/
bufmgr_gem->max_relocs = batch_size / sizeof(uint32_t) / 2 - 2;
- bufmgr_gem->bufmgr.bo_alloc = dri_gem_alloc;
- bufmgr_gem->bufmgr.bo_alloc_static = dri_gem_alloc_static;
+ bufmgr_gem->bufmgr.bo_alloc = dri_gem_bo_alloc;
+ bufmgr_gem->bufmgr.bo_alloc_static = dri_gem_bo_alloc_static;
bufmgr_gem->bufmgr.bo_reference = dri_gem_bo_reference;
bufmgr_gem->bufmgr.bo_unreference = dri_gem_bo_unreference;
bufmgr_gem->bufmgr.bo_map = dri_gem_bo_map;
diff --git a/src/mesa/drivers/dri/intel/intel_ioctl.c b/src/mesa/drivers/dri/intel/intel_ioctl.c
index 2f4caf9535..ec1dec0b1e 100644
--- a/src/mesa/drivers/dri/intel/intel_ioctl.c
+++ b/src/mesa/drivers/dri/intel/intel_ioctl.c
@@ -161,8 +161,6 @@ intel_exec_ioctl(struct intel_context *intel,
if (intel->no_hw)
return;
- memset(&execbuf, 0, sizeof(execbuf));
-
execbuf->batch_start_offset = 0;
execbuf->batch_len = used;
execbuf->cliprects_ptr = (uintptr_t)intel->pClipRects;