summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-09-09 00:38:04 +0100
committerJakob Bornecrantz <[email protected]>2009-09-09 00:43:36 +0100
commite589a37f7b72da4f5eb8cbb46443d7baf710b37c (patch)
tree101fd89d276eb12d107fdfb910e92108a089074b /src/gallium/winsys/drm
parentd1121328402dc2e9480ca69bcfd9e3aac5f024a4 (diff)
i915g: Add buffer write callback
Diffstat (limited to 'src/gallium/winsys/drm')
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c
index e932f71e42c..0030f915a36 100644
--- a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c
+++ b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c
@@ -110,6 +110,18 @@ intel_drm_buffer_unmap(struct intel_winsys *iws,
drm_intel_bo_unmap(intel_bo(buffer));
}
+static int
+intel_drm_buffer_write(struct intel_winsys *iws,
+ struct intel_buffer *buffer,
+ const void *data,
+ size_t size,
+ size_t offset)
+{
+ struct intel_drm_buffer *buf = intel_drm_buffer(buffer);
+
+ return drm_intel_bo_subdata(buf->bo, offset, size, (void*)data);
+}
+
static void
intel_drm_buffer_destroy(struct intel_winsys *iws,
struct intel_buffer *buffer)
@@ -131,5 +143,6 @@ intel_drm_winsys_init_buffer_functions(struct intel_drm_winsys *idws)
idws->base.buffer_set_fence_reg = intel_drm_buffer_set_fence_reg;
idws->base.buffer_map = intel_drm_buffer_map;
idws->base.buffer_unmap = intel_drm_buffer_unmap;
+ idws->base.buffer_write = intel_drm_buffer_write;
idws->base.buffer_destroy = intel_drm_buffer_destroy;
}