Mesa (gallium-resources): r300g: pipe_resource compile fixes

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Mar 23 17:47:28 UTC 2010


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

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Tue Mar 23 18:36:19 2010 +0100

r300g: pipe_resource compile fixes

bring back mistakenly deleted radeon_buffer.h
plus some more

---

 src/gallium/drivers/r300/r300_screen_buffer.c      |    4 +-
 src/gallium/drivers/r300/r300_texture.c            |    2 +-
 src/gallium/drivers/r300/r300_winsys.h             |    2 +-
 src/gallium/winsys/drm/radeon/core/radeon_buffer.h |   86 ++++++++++++++++++++
 src/gallium/winsys/drm/radeon/core/radeon_drm.c    |    1 +
 .../winsys/drm/radeon/core/radeon_drm_buffer.c     |    5 +-
 src/gallium/winsys/drm/radeon/core/radeon_r300.c   |    1 +
 7 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 1bb071d..5ed9f27 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -44,7 +44,7 @@ static unsigned r300_buffer_is_referenced(struct pipe_context *context,
     if (r300_buffer_is_user_buffer(buf))
  	return PIPE_UNREFERENCED;
 
-    if (r300->rws->is_resource_referenced(r300->rws, rbuf->buf))
+    if (r300->rws->is_buffer_referenced(r300->rws, rbuf->buf))
         return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
 
     return PIPE_UNREFERENCED;
@@ -293,7 +293,7 @@ struct u_resource_vtbl r300_buffer_vtbl =
 {
    u_default_resource_get_handle,      /* get_handle */
    r300_buffer_destroy,		     /* resource_destroy */
-   r300_buffer_is_referenced,	     /* is_resource_referenced */
+   r300_buffer_is_referenced,	     /* is_buffer_referenced */
    u_default_get_transfer,	     /* get_transfer */
    u_default_transfer_destroy,	     /* transfer_destroy */
    r300_buffer_transfer_map,	     /* transfer_map */
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index f4040b2..02dadcc 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -770,7 +770,7 @@ static unsigned r300_texture_is_referenced(struct pipe_context *context,
     struct r300_context *r300 = r300_context(context);
     struct r300_texture *rtex = (struct r300_texture *)texture;
 
-    if (r300->rws->is_resource_referenced(r300->rws, rtex->buffer))
+    if (r300->rws->is_buffer_referenced(r300->rws, rtex->buffer))
         return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
 
     return PIPE_UNREFERENCED;
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index 61ec49c..c99c48b 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -159,7 +159,7 @@ struct r300_winsys_screen {
 				 unsigned stride,
 				 struct winsys_handle *whandle);
 
-    boolean (*is_resource_referenced)(struct r300_winsys_screen *winsys,
+    boolean (*is_buffer_referenced)(struct r300_winsys_screen *winsys,
                                     struct r300_winsys_buffer *buffer);
 
   
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h
new file mode 100644
index 0000000..218a376
--- /dev/null
+++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright © 2008 Jérôme Glisse
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ *      Jérôme Glisse <glisse at freedesktop.org>
+ */
+#ifndef RADEON_BUFFER_H
+#define RADEON_BUFFER_H
+
+#include <stdio.h>
+
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+
+#include "pipebuffer/pb_buffer.h"
+#include "pipebuffer/pb_bufmgr.h"
+
+#include "radeon_bo.h"
+#include "radeon_cs.h"
+
+#include "radeon_winsys.h"
+
+
+#define RADEON_MAX_BOS 24
+
+static INLINE struct pb_buffer *
+radeon_pb_buffer(struct r300_winsys_buffer *buffer)
+{
+    return (struct pb_buffer *)buffer;
+}
+
+static INLINE struct r300_winsys_buffer *
+radeon_libdrm_winsys_buffer(struct pb_buffer *buffer)
+{
+    return (struct r300_winsys_buffer *)buffer;
+}
+
+struct pb_manager *
+radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws);
+
+boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf,
+				     uint32_t rd, uint32_t wd);
+
+
+void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf,
+				   uint32_t rd, uint32_t wd,
+				   uint32_t flags);
+
+struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr,
+							      uint32_t handle);
+
+void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf,
+                                  enum r300_buffer_tiling microtiled,
+                                  enum r300_buffer_tiling macrotiled,
+                                  uint32_t pitch);
+
+void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr);
+
+boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
+				     struct winsys_handle *whandle);
+
+boolean radeon_drm_bufmgr_is_buffer_referenced(struct pb_buffer *_buf);
+#endif
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
index acfb36f..7aa9c54 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c
@@ -31,6 +31,7 @@
 
 #include "radeon_drm.h"
 #include "radeon_r300.h"
+#include "radeon_buffer.h"
 
 #include "r300_winsys.h"
 #include "trace/tr_drm.h"
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c
index d9870e8..e66863f 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c
@@ -3,6 +3,7 @@
 #include "radeon_drm.h"
 #include "radeon_bo_gem.h"
 #include "radeon_cs_gem.h"
+#include "radeon_buffer.h"
 
 #include "util/u_inlines.h"
 #include "util/u_memory.h"
@@ -71,7 +72,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf,
     struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf);
     int write;
 
-    if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
+    if (flags & PIPE_TRANSFER_DONTBLOCK) {
 	if ((_buf->base.usage & PIPE_BUFFER_USAGE_VERTEX) ||
 	    (_buf->base.usage & PIPE_BUFFER_USAGE_INDEX))
 	    if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs))
@@ -81,7 +82,7 @@ radeon_drm_buffer_map(struct pb_buffer *_buf,
     if (buf->bo->ptr != NULL)
 	return buf->bo->ptr;
 
-    if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) {
+    if (flags & PIPE_TRANSFER_DONTBLOCK) {
         uint32_t domain;
         if (radeon_bo_is_busy(buf->bo, &domain))
             return NULL;
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 2f89484..38fcf88 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -21,6 +21,7 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
 #include "radeon_r300.h"
+#include "radeon_buffer.h"
 
 #include "radeon_bo_gem.h"
 #include "radeon_cs_gem.h"




More information about the mesa-commit mailing list