Mesa (master): i965: use drm_intel_gem_bo_map/unmap_gtt() when possible, otherwise dri_bo_subdata()
Brian Paul
brianp at kemper.freedesktop.org
Fri Apr 24 15:56:33 UTC 2009
Module: Mesa
Branch: master
Commit: 3321b6984ecd96ba466d8d010e390fff71a799d7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3321b6984ecd96ba466d8d010e390fff71a799d7
Author: Brian Paul <brianp at vmware.com>
Date: Fri Apr 24 09:50:11 2009 -0600
i965: use drm_intel_gem_bo_map/unmap_gtt() when possible, otherwise dri_bo_subdata()
This wraps up the unfinished business from commit a9a363f8298e9d534e60e3d2869f8677138a1e7e
---
src/mesa/drivers/dri/i965/brw_curbe.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index 18b187e..2d15793 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -344,19 +344,23 @@ update_constant_buffer(struct brw_context *brw,
const struct gl_program_parameter_list *params,
dri_bo *const_buffer)
{
+ struct intel_context *intel = &brw->intel;
const int size = params->NumParameters * 4 * sizeof(GLfloat);
/* copy Mesa program constants into the buffer */
if (const_buffer && size > 0) {
- GLubyte *map;
assert(const_buffer);
assert(const_buffer->size >= size);
- dri_bo_map(const_buffer, GL_TRUE);
- map = const_buffer->virtual;
- memcpy(map, params->ParameterValues, size);
- dri_bo_unmap(const_buffer);
+ if (intel->intelScreen->kernel_exec_fencing) {
+ drm_intel_gem_bo_map_gtt(const_buffer);
+ memcpy(const_buffer->virtual, params->ParameterValues, size);
+ drm_intel_gem_bo_unmap_gtt(const_buffer);
+ }
+ else {
+ dri_bo_subdata(const_buffer, 0, size, params->ParameterValues);
+ }
if (0) {
int i;
More information about the mesa-commit
mailing list