aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/dri_drawable.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-08-27 18:57:29 +0100
committerJakob Bornecrantz <[email protected]>2009-08-28 13:38:23 +0100
commit1e5014f7dfabcaf1f4b5608eb08e97179446eb09 (patch)
tree75ab693e5e07467c36fd3593c440143d62ce907e /src/gallium/state_trackers/dri/dri_drawable.c
parent7d9af52bc59bfeb19d9bdb55258f4a830a1b0d04 (diff)
drm_api: Operate on textures instead of buffers
Most use cases just got the buffer from the texture and then called into one of the get_handle functions. Also with this patch it would be easier to move to a generic function for getting handles from textures and textures from handles, that is exposed via the screen.
Diffstat (limited to 'src/gallium/state_trackers/dri/dri_drawable.c')
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 2265187880b..bcfd1c06fec 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -56,13 +56,6 @@ dri_surface_from_handle(struct drm_api *api,
struct pipe_surface *surface = NULL;
struct pipe_texture *texture = NULL;
struct pipe_texture templat;
- struct pipe_buffer *buf = NULL;
-
- buf = api->buffer_from_handle(api, screen, "dri2 buffer", handle);
- if (!buf) {
- debug_printf("%s: Failed to get buffer from handle\n", __func__);
- return NULL;
- }
memset(&templat, 0, sizeof(templat));
templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET;
@@ -74,10 +67,8 @@ dri_surface_from_handle(struct drm_api *api,
templat.height[0] = height;
pf_get_block(templat.format, &templat.block);
- texture = screen->texture_blanket(screen, &templat, &pitch, buf);
-
- /* we don't need the buffer from this point on */
- pipe_buffer_reference(&buf, NULL);
+ texture = api->texture_from_shared_handle(api, screen, &templat,
+ "dri2 buffer", pitch, handle);
if (!texture) {
debug_printf("%s: Failed to blanket the buffer with a texture\n", __func__);