aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-09-25 13:59:56 +0200
committerChristian König <[email protected]>2013-09-25 19:41:31 +0200
commit4871128e58402385dc6f920884273c003a1124e1 (patch)
tree90abea06f7ff8f5b8a0b519de6f1d8e53dfea023 /src/gallium/winsys/radeon/drm
parentf6e2aa0e12e4ce91dc6f8ac5140d6e1f511ea468 (diff)
radeon/winsys: keep screen pointer in winsys v2
Only create one screen for each winsys instance. This helps with buffer sharing and interop handling. v2: rebased and some minor cleanup Signed-off-by: Christian König <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon/drm')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_winsys.h15
2 files changed, 15 insertions, 4 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index 61f091323f4..4f43093d71d 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -424,10 +424,6 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
{
struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;
- if (!pipe_reference(&ws->base.reference, NULL)) {
- return;
- }
-
if (ws->thread) {
ws->kill_thread = 1;
pipe_semaphore_signal(&ws->cs_queued);
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h
index 1367982850c..581cd841cd8 100644
--- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
@@ -208,6 +208,11 @@ struct radeon_winsys {
struct pipe_reference reference;
/**
+ * The screen object this winsys was created for
+ */
+ struct pipe_screen *screen;
+
+ /**
* Destroy this winsys.
*
* \param ws The winsys this function is called from.
@@ -501,6 +506,16 @@ struct radeon_winsys {
enum radeon_value_id value);
};
+/**
+ * Decrement the winsys reference count.
+ *
+ * \param ws The winsys this function is called for.
+ */
+static INLINE boolean radeon_winsys_unref(struct radeon_winsys *ws)
+{
+ return pipe_reference(&ws->reference, NULL);
+}
+
static INLINE void radeon_emit(struct radeon_winsys_cs *cs, uint32_t value)
{
cs->buf[cs->cdw++] = value;