Module: Mesa
Branch: gallium-resources
Commit: eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb39977fe7a1d9f0c3f4f2d4303a93c2c613cc3b

Author: Keith Whitwell <[email protected]>
Date:   Sun Mar 21 22:23:51 2010 +0000

st/dri: update for pipe_resources

---

 src/gallium/state_trackers/dri/dri1.c         |   18 +++++++++---------
 src/gallium/state_trackers/dri/dri1.h         |    2 +-
 src/gallium/state_trackers/dri/dri_drawable.c |    4 ++--
 src/gallium/state_trackers/dri/dri_drawable.h |    2 +-
 src/gallium/state_trackers/dri/dri_st_api.c   |   14 +++++++-------
 src/gallium/state_trackers/dri/dri_st_api.h   |    2 +-
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri1.c 
b/src/gallium/state_trackers/dri/dri1.c
index 240bc69..64a4842 100644
--- a/src/gallium/state_trackers/dri/dri1.c
+++ b/src/gallium/state_trackers/dri/dri1.c
@@ -214,7 +214,7 @@ dri1_swap_copy(struct pipe_context *pipe,
 }
 
 static struct pipe_surface *
-dri1_get_pipe_surface(struct dri_drawable *drawable, struct pipe_texture *ptex)
+dri1_get_pipe_surface(struct dri_drawable *drawable, struct pipe_resource 
*ptex)
 {
    struct pipe_screen *pipe_screen = dri_screen(drawable->sPriv)->pipe_screen;
    struct pipe_surface *psurf = drawable->dri1_surface;
@@ -248,7 +248,7 @@ dri1_get_pipe_context(struct dri_drawable *drawable)
 
 static void
 dri1_present_texture_locked(__DRIdrawable * dPriv,
-                            struct pipe_texture *ptex,
+                            struct pipe_resource *ptex,
                             const struct drm_clip_rect *sub_box,
                             struct pipe_fence_handle **fence)
 {
@@ -291,7 +291,7 @@ dri1_present_texture_locked(__DRIdrawable * dPriv,
 
 static void
 dri1_copy_to_front(struct dri_context *ctx,
-                  struct pipe_texture *ptex,
+                  struct pipe_resource *ptex,
                   __DRIdrawable * dPriv,
                   const struct drm_clip_rect *sub_box,
                   struct pipe_fence_handle **fence)
@@ -319,7 +319,7 @@ dri1_copy_to_front(struct dri_context *ctx,
 
 void
 dri1_flush_frontbuffer(struct dri_drawable *drawable,
-                       struct pipe_texture *ptex)
+                       struct pipe_resource *ptex)
 {
    struct st_api *stapi = dri_get_st_api();
    struct dri_screen *screen = dri_screen(drawable->sPriv);
@@ -349,7 +349,7 @@ dri1_swap_buffers(__DRIdrawable * dPriv)
    struct dri_screen *screen = dri_screen(draw->sPriv);
    struct pipe_screen *pipe_screen = screen->pipe_screen;
    struct pipe_fence_handle *fence;
-   struct pipe_texture *ptex;
+   struct pipe_resource *ptex;
 
    assert(__dri1_api_hooks != NULL);
 
@@ -379,7 +379,7 @@ dri1_copy_sub_buffer(__DRIdrawable * dPriv, int x, int y, 
int w, int h)
    struct drm_clip_rect sub_bbox;
    struct dri_drawable *draw = dri_drawable(dPriv);
    struct pipe_fence_handle *dummy_fence;
-   struct pipe_texture *ptex;
+   struct pipe_resource *ptex;
 
    assert(__dri1_api_hooks != NULL);
 
@@ -405,13 +405,13 @@ dri1_allocate_textures(struct dri_drawable *drawable,
                        unsigned mask)
 {
    struct dri_screen *screen = dri_screen(drawable->sPriv);
-   struct pipe_texture templ;
+   struct pipe_resource templ;
    int i;
 
    /* remove outdated textures */
    if (drawable->old_w != width || drawable->old_h != height) {
       for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
-         pipe_texture_reference(&drawable->textures[i], NULL);
+         pipe_resource_reference(&drawable->textures[i], NULL);
    }
 
    memset(&templ, 0, sizeof(templ));
@@ -456,7 +456,7 @@ dri1_allocate_textures(struct dri_drawable *drawable,
          templ.tex_usage = tex_usage;
 
          drawable->textures[i] =
-            screen->pipe_screen->texture_create(screen->pipe_screen, &templ);
+            screen->pipe_screen->resource_create(screen->pipe_screen, &templ);
       }
    }
 
diff --git a/src/gallium/state_trackers/dri/dri1.h 
b/src/gallium/state_trackers/dri/dri1.h
index e83571e..2ac1ed7 100644
--- a/src/gallium/state_trackers/dri/dri1.h
+++ b/src/gallium/state_trackers/dri/dri1.h
@@ -45,7 +45,7 @@ dri1_init_screen(__DRIscreen * sPriv);
 
 void
 dri1_flush_frontbuffer(struct dri_drawable *drawable,
-                       struct pipe_texture *ptex);
+                       struct pipe_resource *ptex);
 
 void
 dri1_allocate_textures(struct dri_drawable *drawable,
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c 
b/src/gallium/state_trackers/dri/dri_drawable.c
index 930387f..7437d75 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -48,7 +48,7 @@ void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
 {
    struct dri_context *ctx = dri_context(pDRICtx);
    struct dri_drawable *drawable = dri_drawable(dPriv);
-   struct pipe_texture *pt =
+   struct pipe_resource *pt =
       dri_get_st_framebuffer_texture(drawable->stfb, ST_ATTACHMENT_FRONT_LEFT);
 
    if (pt) {
@@ -109,7 +109,7 @@ dri_destroy_buffer(__DRIdrawable * dPriv)
 
    pipe_surface_reference(&drawable->dri1_surface, NULL);
    for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
-      pipe_texture_reference(&drawable->textures[i], NULL);
+      pipe_resource_reference(&drawable->textures[i], NULL);
 
    dri_destroy_st_framebuffer(drawable->stfb);
 
diff --git a/src/gallium/state_trackers/dri/dri_drawable.h 
b/src/gallium/state_trackers/dri/dri_drawable.h
index 7f687b6..6aa424a 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.h
+++ b/src/gallium/state_trackers/dri/dri_drawable.h
@@ -55,7 +55,7 @@ struct dri_drawable
    unsigned old_w;
    unsigned old_h;
 
-   struct pipe_texture *textures[ST_ATTACHMENT_COUNT];
+   struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
    unsigned int texture_mask, texture_stamp;
 
    struct pipe_fence_handle *swap_fences[DRI_SWAP_FENCES_MAX];
diff --git a/src/gallium/state_trackers/dri/dri_st_api.c 
b/src/gallium/state_trackers/dri/dri_st_api.c
index 2cde019..7533cc4 100644
--- a/src/gallium/state_trackers/dri/dri_st_api.c
+++ b/src/gallium/state_trackers/dri/dri_st_api.c
@@ -79,7 +79,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
 {
    struct dri_screen *screen = dri_screen(drawable->sPriv);
    __DRIdrawable *dri_drawable = drawable->dPriv;
-   struct pipe_texture templ;
+   struct pipe_resource templ;
    struct winsys_handle whandle;
    boolean have_depth = FALSE;
    unsigned i;
@@ -91,7 +91,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
       return;
 
    for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
-      pipe_texture_reference(&drawable->textures[i], NULL);
+      pipe_resource_reference(&drawable->textures[i], NULL);
 
    memset(&templ, 0, sizeof(templ));
    templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
@@ -145,7 +145,7 @@ dri_drawable_process_buffers(struct dri_drawable *drawable,
       whandle.stride = buf->pitch;
    
       drawable->textures[statt] =
-         screen->pipe_screen->texture_from_handle(screen->pipe_screen,
+         screen->pipe_screen->resource_from_handle(screen->pipe_screen,
                &templ, &whandle);
    }
 
@@ -254,7 +254,7 @@ static boolean
 dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
                             const enum st_attachment_type *statts,
                             unsigned count,
-                            struct pipe_texture **out)
+                            struct pipe_resource **out)
 {
    struct dri_drawable *drawable =
       (struct dri_drawable *) stfbi->st_manager_private;
@@ -294,7 +294,7 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface 
*stfbi,
 
    for (i = 0; i < count; i++) {
       out[i] = NULL;
-      pipe_texture_reference(&out[i], drawable->textures[statts[i]]);
+      pipe_resource_reference(&out[i], drawable->textures[statts[i]]);
    }
 
    return TRUE;
@@ -310,7 +310,7 @@ dri_st_framebuffer_flush_front(struct st_framebuffer_iface 
*stfbi,
       drawable->sPriv->dri2.loader;
 
    if (__dri1_api_hooks) {
-      struct pipe_texture *ptex = drawable->textures[statt];
+      struct pipe_resource *ptex = drawable->textures[statt];
       if (ptex)
          dri1_flush_frontbuffer(drawable, ptex);
       return TRUE;
@@ -356,7 +356,7 @@ dri_destroy_st_framebuffer(struct st_framebuffer_iface 
*stfbi)
  * Return the texture at an attachment.  Allocate the texture if it does not
  * exist.
  */
-struct pipe_texture *
+struct pipe_resource *
 dri_get_st_framebuffer_texture(struct st_framebuffer_iface *stfbi,
                                enum st_attachment_type statt)
 {
diff --git a/src/gallium/state_trackers/dri/dri_st_api.h 
b/src/gallium/state_trackers/dri/dri_st_api.h
index 7cf522e..0869c62 100644
--- a/src/gallium/state_trackers/dri/dri_st_api.h
+++ b/src/gallium/state_trackers/dri/dri_st_api.h
@@ -48,7 +48,7 @@ dri_create_st_framebuffer(struct dri_drawable *drawable);
 void
 dri_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi);
 
-struct pipe_texture *
+struct pipe_resource *
 dri_get_st_framebuffer_texture(struct st_framebuffer_iface *stfbi,
                                enum st_attachment_type statt);
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to