tu: Implement fallback linear staging blit for CopyImage
[mesa.git] / src / gallium / state_trackers / hgl / hgl.c
index 0e122fe86ae90a31aed79a945c564a0311febe93..f7dc7a6d3dbadbaf853a40382fcf83347c8d948d 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "pipe/p_format.h"
 #include "util/u_atomic.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
 #include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
@@ -44,7 +44,8 @@ hgl_st_context(struct st_context_iface *stctxi)
 
 
 // Perform a safe void to hgl_buffer cast
-static inline struct hgl_buffer*
+//static inline struct hgl_buffer*
+struct hgl_buffer*
 hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
 {
        struct hgl_buffer* buffer;
@@ -55,29 +56,31 @@ hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
 }
 
 
-static boolean
+static bool
 hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
        struct st_framebuffer_iface* stfbi, enum st_attachment_type statt)
 {
        CALLED();
 
        //struct hgl_context* context = hgl_st_context(stctxi);
-       //struct hgl_buffer* buffer = hgl_st_context(stfbi);
+       // struct hgl_buffer* buffer = hgl_st_context(stfbi);
+       struct hgl_buffer* buffer = hgl_st_framebuffer(stfbi);
+       //buffer->surface
 
        #if 0
        struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
-       pipe_mutex_lock(stwfb->fb->mutex);
+       mtx_lock(&stwfb->fb->mutex);
 
        struct pipe_resource* resource = textures[statt];
        if (resource)
                stw_framebuffer_present_locked(...);
        #endif
 
-       return TRUE;
+       return true;
 }
 
 
-static boolean
+static bool
 hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
        unsigned width, unsigned height, unsigned mask)
 {
@@ -138,7 +141,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
        buffer->height = height;
        buffer->mask = mask;
 
-       return TRUE;
+       return true;
 }
 
 
@@ -146,7 +149,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
  * Called by the st manager to validate the framebuffer (allocate
  * its resources).
  */
-static boolean
+static bool
 hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
        struct st_framebuffer_iface *stfbi, const enum st_attachment_type *statts,
        unsigned count, struct pipe_resource **out)
@@ -155,7 +158,7 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
        struct hgl_buffer* buffer;
        unsigned stAttachmentMask, newMask;
        unsigned i;
-       boolean resized;
+       bool resized;
 
        CALLED();
 
@@ -193,12 +196,10 @@ hgl_st_framebuffer_validate(struct st_context_iface *stctxi,
                //}
        }
 
-       for (i = 0; i < count; i++) {
-               out[i] = NULL;
+       for (i = 0; i < count; i++)
                pipe_resource_reference(&out[i], buffer->textures[statts[i]]);
-       }
 
-       return TRUE;
+       return true;
 }
 
 
@@ -283,7 +284,8 @@ hgl_create_st_manager(struct hgl_context* context)
        //manager->display = dpy;
        manager->screen = context->screen;
        manager->get_param = hgl_st_manager_get_param;
-
+       manager->st_manager_private = (void *)context;
+       
        return manager;
 }