diff options
author | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-03 19:30:48 +0200 |
---|---|---|
committer | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-03 19:30:48 +0200 |
commit | 6d25b9125ec1e66e0e255b0ee20fe18dfe1076fa (patch) | |
tree | c376951940eac2875567979a81e6a03a019942b7 /src/gallium/winsys/drm | |
parent | 81c7561d9d3faf70ac22c6a5f3fbea18f53eed92 (diff) | |
parent | 7d2699aedc084d9cb9c2bd2f8bdb5f038271ac1e (diff) |
Merge branch 'master' into r300-compiler
Diffstat (limited to 'src/gallium/winsys/drm')
4 files changed, 23 insertions, 3 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c index 4c5a1d2ea8..8b647a769b 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c @@ -7,6 +7,7 @@ #include "i915simple/i915_context.h" #include "i915simple/i915_screen.h" +#include "trace/tr_drm.h" /* * Helper functions @@ -40,6 +41,7 @@ intel_drm_buffer_from_handle(struct intel_drm_winsys *idws, const char* name, unsigned handle) { struct intel_drm_buffer *buf = CALLOC_STRUCT(intel_drm_buffer); + uint32_t tile = 0, swizzle = 0; if (!buf) return NULL; @@ -52,6 +54,10 @@ intel_drm_buffer_from_handle(struct intel_drm_winsys *idws, if (!buf->bo) goto err; + drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle); + if (tile != INTEL_TILE_NONE) + buf->map_gtt = TRUE; + return (struct intel_buffer *)buf; err: @@ -166,6 +172,7 @@ intel_drm_create_screen(struct drm_api *api, int drmFD, idws->base.destroy = intel_drm_winsys_destroy; idws->pools.gem = drm_intel_bufmgr_gem_init(idws->fd, idws->max_batch_size); + drm_intel_bufmgr_gem_enable_reuse(idws->pools.gem); idws->softpipe = FALSE; idws->dump_cmd = debug_get_bool_option("INTEL_DUMP_CMD", FALSE); @@ -198,5 +205,5 @@ struct drm_api intel_drm_api = struct drm_api * drm_api_create() { - return &intel_drm_api; + return trace_drm_create(&intel_drm_api); } 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 0030f915a3..327e19fcd6 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c @@ -58,11 +58,17 @@ intel_drm_buffer_set_fence_reg(struct intel_winsys *iws, unsigned stride, enum intel_buffer_tile tile) { + struct intel_drm_buffer *buf = intel_drm_buffer(buffer); assert(I915_TILING_NONE == INTEL_TILE_NONE); assert(I915_TILING_X == INTEL_TILE_X); assert(I915_TILING_Y == INTEL_TILE_Y); - return drm_intel_bo_set_tiling(intel_bo(buffer), &tile, stride); + if (tile != INTEL_TILE_NONE) { + assert(buf->map_count == 0); + buf->map_gtt = TRUE; + } + + return drm_intel_bo_set_tiling(buf->bo, &tile, stride); } static void * diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index a4011db0b8..caab33de1c 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -107,13 +107,18 @@ radeon_texture_from_shared_handle(struct drm_api *api, unsigned handle) { struct pipe_buffer *buffer; + struct pipe_texture *blanket; buffer = radeon_buffer_from_handle(api, screen, name, handle); if (!buffer) { return NULL; } - return screen->texture_blanket(screen, templ, &stride, buffer); + blanket = screen->texture_blanket(screen, templ, &stride, buffer); + + pipe_buffer_reference(&buffer, NULL); + + return blanket; } static boolean radeon_shared_handle_from_texture(struct drm_api *api, diff --git a/src/gallium/winsys/drm/radeon/xorg/Makefile b/src/gallium/winsys/drm/radeon/xorg/Makefile index 0241625f69..9fa16dab24 100644 --- a/src/gallium/winsys/drm/radeon/xorg/Makefile +++ b/src/gallium/winsys/drm/radeon/xorg/Makefile @@ -20,6 +20,8 @@ LIBS = \ $(GALLIUMDIR)/state_trackers/xorg/libxorgtracker.a \ $(GALLIUMDIR)/winsys/drm/radeon/core/libradeonwinsys.a \ $(TOP)/src/gallium/drivers/r300/libr300.a \ + $(TOP)/src/gallium/drivers/trace/libtrace.a \ + $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \ $(GALLIUM_AUXILIARIES) ############################################# |