diff options
author | Jakob Bornecrantz <[email protected]> | 2009-07-01 01:16:56 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-07-01 01:20:04 +0200 |
commit | 64849d1236e33b3325e00167c97119af52990ad8 (patch) | |
tree | 86822bf884ba54a5f1f4bab6949a764442c54448 /src/gallium/winsys/drm/intel | |
parent | 119eb4094256742013224afb7c5704b6254b6296 (diff) |
drm/st: Remove drm_api struct from drivers
Remove the drm_api from the functions in the softpipe and
i915simple drivers. Create wrapper functions in the
backends instead.
Diffstat (limited to 'src/gallium/winsys/drm/intel')
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_api.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_device.c | 19 | ||||
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_device.h | 9 |
3 files changed, 28 insertions, 2 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_api.c b/src/gallium/winsys/drm/intel/gem/intel_be_api.c index d22d11e7237..09d4ba47290 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_api.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_api.c @@ -14,7 +14,7 @@ struct drm_api intel_be_drm_api = .create_context = intel_be_create_context, /* intel_be_device.c */ .create_screen = intel_be_create_screen, - .buffer_from_texture = i915_get_texture_buffer, + .buffer_from_texture = intel_be_get_texture_buffer, .buffer_from_handle = intel_be_buffer_from_handle, .handle_from_buffer = intel_be_handle_from_buffer, .global_handle_from_buffer = intel_be_global_handle_from_buffer, diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.c b/src/gallium/winsys/drm/intel/gem/intel_be_device.c index 2d531279f77..e3630f5d120 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.c +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.c @@ -142,6 +142,24 @@ err: return NULL; } +boolean +intel_be_get_texture_buffer(struct drm_api *api, + struct pipe_texture *texture, + struct pipe_buffer **buffer, + unsigned *stride) +{ + struct intel_be_device *dev; + + if (!texture) + return FALSE; + + dev = intel_be_device(texture->screen->winsys); + if (dev->softpipe) + return softpipe_get_texture_buffer(texture, buffer, stride); + else + return i915_get_texture_buffer(texture, buffer, stride); +} + struct pipe_buffer * intel_be_buffer_from_handle(struct drm_api *api, struct pipe_screen *screen, @@ -344,7 +362,6 @@ intel_be_create_screen(struct drm_api *api, int drmFD, if (dev->softpipe) { screen = softpipe_create_screen(&dev->base); - intel_be_drm_api.buffer_from_texture = softpipe_get_texture_buffer; } else screen = i915_create_screen(&dev->base, deviceID); diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h index 777161daca0..56d95bd7fe0 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h @@ -52,6 +52,15 @@ struct intel_be_buffer { unsigned flink; }; +/* + * Wrapper for driver get_texture_buffer functions. + */ +boolean +intel_be_get_texture_buffer(struct drm_api *api, + struct pipe_texture *texture, + struct pipe_buffer **buffer, + unsigned *stride); + /** * Create a be buffer from a drm bo handle. * |