summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/amd_legacy_fence.h39
-rw-r--r--shared-core/radeon_ms.h1
-rw-r--r--shared-core/radeon_ms_drm.c7
-rw-r--r--shared-core/radeon_ms_fence.c16
4 files changed, 51 insertions, 12 deletions
diff --git a/shared-core/amd_legacy_fence.h b/shared-core/amd_legacy_fence.h
new file mode 100644
index 00000000..d82138ba
--- /dev/null
+++ b/shared-core/amd_legacy_fence.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2007 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, sublicense,
+ * 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 above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * 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 NONINFRINGEMENT. IN NO EVENT SHALL
+ * PRECISION INSIGHT 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.
+ *
+ * Authors:
+ * Dave Airlie
+ * Jerome Glisse <glisse@freedesktop.org>
+ */
+#ifndef __AMD_LEGACY_FENCE_H__
+#define __AMD_LEGACY_FENCE_H__
+
+struct legacy_fence
+{
+ uint32_t sequence;
+ uint32_t sequence_last_reported;
+ uint32_t sequence_last_flush;
+ uint32_t fence_reg;
+};
+
+#endif
diff --git a/shared-core/radeon_ms.h b/shared-core/radeon_ms.h
index 12c945f9..d9aa0351 100644
--- a/shared-core/radeon_ms.h
+++ b/shared-core/radeon_ms.h
@@ -31,7 +31,6 @@
#define __RADEON_MS_H__
#include "radeon_ms_drv.h"
-#include "amd_r3xx_fence.h"
#include "radeon_ms_reg.h"
#include "radeon_ms_drm.h"
#include "radeon_ms_rom.h"
diff --git a/shared-core/radeon_ms_drm.c b/shared-core/radeon_ms_drm.c
index b9245d99..40f5d791 100644
--- a/shared-core/radeon_ms_drm.c
+++ b/shared-core/radeon_ms_drm.c
@@ -29,6 +29,7 @@
*/
#include "drm_pciids.h"
#include "radeon_ms.h"
+#include "amd_legacy_fence.h"
static uint32_t radeon_ms_mem_prios[] = {
@@ -116,12 +117,12 @@ int radeon_ms_driver_load(struct drm_device *dev, unsigned long flags)
return ret;
}
- dev_priv->fence = drm_alloc(sizeof(struct r3xx_fence), DRM_MEM_DRIVER);
+ dev_priv->fence = drm_alloc(sizeof(struct legacy_fence), DRM_MEM_DRIVER);
if (dev_priv->fence == NULL) {
radeon_ms_driver_unload(dev);
return -ENOMEM;
}
- memset(dev_priv->fence, 0, sizeof(struct r3xx_fence));
+ memset(dev_priv->fence, 0, sizeof(struct legacy_fence));
/* we don't want userspace to be able to map this so don't use
* drm_addmap */
@@ -305,7 +306,7 @@ int radeon_ms_driver_unload(struct drm_device *dev)
drm_core_ioremapfree(&dev_priv->vram, dev);
}
DRM_INFO("[radeon_ms] map released\n");
- drm_free(dev_priv->fence, sizeof(struct r3xx_fence), DRM_MEM_DRIVER);
+ drm_free(dev_priv->fence, sizeof(struct legacy_fence), DRM_MEM_DRIVER);
drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER);
dev->dev_private = NULL;
diff --git a/shared-core/radeon_ms_fence.c b/shared-core/radeon_ms_fence.c
index 162d37d6..994c3e48 100644
--- a/shared-core/radeon_ms_fence.c
+++ b/shared-core/radeon_ms_fence.c
@@ -27,7 +27,7 @@
* Jerome Glisse <glisse@freedesktop.org>
*/
#include "radeon_ms.h"
-#include "amd_r3xx_fence.h"
+#include "amd_legacy_fence.h"
#define R3XX_FENCE_SEQUENCE_RW_FLUSH 0x80000000u
@@ -35,7 +35,7 @@ static inline int r3xx_fence_emit_sequence(struct drm_device *dev,
struct drm_radeon_private *dev_priv,
uint32_t sequence)
{
- struct r3xx_fence *r3xx_fence = dev_priv->fence;
+ struct legacy_fence *r3xx_fence = dev_priv->fence;
uint32_t cmd[2];
int i, r;
@@ -58,7 +58,7 @@ static inline int r3xx_fence_emit_sequence(struct drm_device *dev,
return -EBUSY;
}
-static inline uint32_t r3xx_fence_sequence(struct r3xx_fence *r3xx_fence)
+static inline uint32_t r3xx_fence_sequence(struct legacy_fence *r3xx_fence)
{
r3xx_fence->sequence += 1;
if (unlikely(r3xx_fence->sequence > 0x7fffffffu)) {
@@ -69,7 +69,7 @@ static inline uint32_t r3xx_fence_sequence(struct r3xx_fence *r3xx_fence)
static inline void r3xx_fence_report(struct drm_device *dev,
struct drm_radeon_private *dev_priv,
- struct r3xx_fence *r3xx_fence)
+ struct legacy_fence *r3xx_fence)
{
uint32_t fence_types = DRM_FENCE_TYPE_EXE;
uint32_t sequence;
@@ -95,7 +95,7 @@ static inline void r3xx_fence_report(struct drm_device *dev,
static void r3xx_fence_flush(struct drm_device *dev, uint32_t class)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
- struct r3xx_fence *r3xx_fence = dev_priv->fence;
+ struct legacy_fence *r3xx_fence = dev_priv->fence;
uint32_t sequence;
sequence = r3xx_fence_sequence(r3xx_fence);
@@ -109,7 +109,7 @@ static void r3xx_fence_poll(struct drm_device *dev, uint32_t fence_class,
struct drm_radeon_private *dev_priv = dev->dev_private;
struct drm_fence_manager *fm = &dev->fm;
struct drm_fence_class_manager *fc = &fm->fence_class[fence_class];
- struct r3xx_fence *r3xx_fence = dev_priv->fence;
+ struct legacy_fence *r3xx_fence = dev_priv->fence;
if (unlikely(!dev_priv)) {
return;
@@ -129,7 +129,7 @@ static int r3xx_fence_emit(struct drm_device *dev, uint32_t class,
uint32_t *native_type)
{
struct drm_radeon_private *dev_priv = dev->dev_private;
- struct r3xx_fence *r3xx_fence = dev_priv->fence;
+ struct legacy_fence *r3xx_fence = dev_priv->fence;
uint32_t tmp;
if (!dev_priv || dev_priv->cp_ready != 1) {
@@ -162,7 +162,7 @@ static uint32_t r3xx_fence_needed_flush(struct drm_fence_object *fence)
{
struct drm_device *dev = fence->dev;
struct drm_radeon_private *dev_priv = dev->dev_private;
- struct r3xx_fence *r3xx_fence = dev_priv->fence;
+ struct legacy_fence *r3xx_fence = dev_priv->fence;
struct drm_fence_driver *driver = dev->driver->fence_driver;
uint32_t flush_types, diff;