summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/sis_drv.h29
-rw-r--r--shared-core/via_drm.h6
-rw-r--r--shared-core/via_drv.c5
-rw-r--r--shared-core/via_drv.h19
-rw-r--r--shared-core/via_map.c12
5 files changed, 64 insertions, 7 deletions
diff --git a/shared-core/sis_drv.h b/shared-core/sis_drv.h
index e218e526..037bc49d 100644
--- a/shared-core/sis_drv.h
+++ b/shared-core/sis_drv.h
@@ -34,11 +34,32 @@
#define DRIVER_AUTHOR "SIS"
#define DRIVER_NAME "sis"
#define DRIVER_DESC "SIS 300/630/540"
-#define DRIVER_DATE "20030826"
+#define DRIVER_DATE "20060529"
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 1
+#define DRIVER_MINOR 2
#define DRIVER_PATCHLEVEL 0
+#if defined(__linux__)
+#define SIS_HAVE_CORE_MM
+#endif
+
+#ifdef SIS_HAVE_CORE_MM
+
+#include "drm_sman.h"
+typedef struct drm_sis_private {
+ drm_local_map_t *mmio;
+ unsigned idle_fault;
+ drm_sman_t sman;
+ unsigned long chipset;
+ int vram_initialized;
+ int agp_initialized;
+ unsigned long vram_offset;
+ unsigned long agp_offset;
+} drm_sis_private_t;
+
+extern void sis_reclaim_buffers_locked(drm_device_t *dev, struct file *filp);
+
+#else
#include "sis_ds.h"
typedef struct drm_sis_private {
@@ -47,6 +68,10 @@ typedef struct drm_sis_private {
} drm_sis_private_t;
extern int sis_init_context(drm_device_t * dev, int context);
+
+#endif
+
+
extern int sis_final_context(drm_device_t * dev, int context);
extern drm_ioctl_desc_t sis_ioctls[];
diff --git a/shared-core/via_drm.h b/shared-core/via_drm.h
index dbaf857b..4be7e249 100644
--- a/shared-core/via_drm.h
+++ b/shared-core/via_drm.h
@@ -42,11 +42,11 @@
* backwards incompatibilities, (which should be avoided whenever possible).
*/
-#define VIA_DRM_DRIVER_DATE "20060111"
+#define VIA_DRM_DRIVER_DATE "20060528"
#define VIA_DRM_DRIVER_MAJOR 2
-#define VIA_DRM_DRIVER_MINOR 9
-#define VIA_DRM_DRIVER_PATCHLEVEL 1
+#define VIA_DRM_DRIVER_MINOR 10
+#define VIA_DRM_DRIVER_PATCHLEVEL 0
#define VIA_DRM_DRIVER_VERSION (((VIA_DRM_DRIVER_MAJOR) << 16) | (VIA_DRM_DRIVER_MINOR))
#define VIA_NR_SAREA_CLIPRECTS 8
diff --git a/shared-core/via_drv.c b/shared-core/via_drv.c
index 2dc72ec1..a7509cff 100644
--- a/shared-core/via_drv.c
+++ b/shared-core/via_drv.c
@@ -46,7 +46,9 @@ static struct drm_driver driver = {
DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL,
.load = via_driver_load,
.unload = via_driver_unload,
+#ifndef VIA_HAVE_CORE_MM
.context_ctor = via_init_context,
+#endif
.context_dtor = via_final_context,
.vblank_wait = via_driver_vblank_wait,
.irq_preinstall = via_driver_irq_preinstall,
@@ -56,6 +58,9 @@ static struct drm_driver driver = {
.dma_quiescent = via_driver_dma_quiescent,
.dri_library_name = dri_library_name,
.reclaim_buffers = drm_core_reclaim_buffers,
+#ifdef VIA_HAVE_CORE_MM
+ .reclaim_buffers_locked = via_reclaim_buffers_locked,
+#endif
.get_map_ofs = drm_core_get_map_ofs,
.get_reg_ofs = drm_core_get_reg_ofs,
.ioctls = via_ioctls,
diff --git a/shared-core/via_drv.h b/shared-core/via_drv.h
index 0e29815b..2e9e10c3 100644
--- a/shared-core/via_drv.h
+++ b/shared-core/via_drv.h
@@ -24,6 +24,7 @@
#ifndef _VIA_DRV_H_
#define _VIA_DRV_H_
+#include "drm_sman.h"
#define DRIVER_AUTHOR "Various"
#define DRIVER_NAME "via"
@@ -39,6 +40,7 @@
* the DMA blit code has been implemented for FreeBSD.
*/
#define VIA_HAVE_DMABLIT 1
+#define VIA_HAVE_CORE_MM 1
#endif
#define VIA_PCI_BUF_SIZE 60000
@@ -88,6 +90,15 @@ typedef struct drm_via_private {
uint32_t irq_enable_mask;
uint32_t irq_pending_mask;
int *irq_map;
+ /* Memory manager stuff */
+#ifdef VIA_HAVE_CORE_MM
+ unsigned idle_fault;
+ drm_sman_t sman;
+ int vram_initialized;
+ int agp_initialized;
+ unsigned long vram_offset;
+ unsigned long agp_offset;
+#endif
#ifdef VIA_HAVE_DMABLIT
drm_via_blitq_t blit_queues[VIA_NUM_BLIT_ENGINES];
#endif
@@ -121,7 +132,6 @@ extern int via_dma_blit( DRM_IOCTL_ARGS );
extern int via_driver_load(drm_device_t *dev, unsigned long chipset);
extern int via_driver_unload(drm_device_t *dev);
-extern int via_init_context(drm_device_t * dev, int context);
extern int via_final_context(drm_device_t * dev, int context);
extern int via_do_cleanup_map(drm_device_t * dev);
@@ -140,6 +150,13 @@ extern void via_cleanup_futex(drm_via_private_t *dev_priv);
extern void via_release_futex(drm_via_private_t *dev_priv, int context);
extern int via_driver_irq_wait(drm_device_t * dev, unsigned int irq,
int force_sequence, unsigned int *sequence);
+
+#ifdef VIA_HAVE_CORE_MM
+extern void via_reclaim_buffers_locked(drm_device_t *dev, struct file *filp);
+#else
+extern int via_init_context(drm_device_t * dev, int context);
+#endif
+
#ifdef VIA_HAVE_DMABLIT
extern void via_dmablit_handler(drm_device_t *dev, int engine, int from_irq);
extern void via_init_dmablit(drm_device_t *dev);
diff --git a/shared-core/via_map.c b/shared-core/via_map.c
index 2b653d75..71967d6c 100644
--- a/shared-core/via_map.c
+++ b/shared-core/via_map.c
@@ -99,6 +99,7 @@ int via_map_init(DRM_IOCTL_ARGS)
int via_driver_load(drm_device_t *dev, unsigned long chipset)
{
drm_via_private_t *dev_priv;
+ int ret = 0;
dev_priv = drm_calloc(1, sizeof(drm_via_private_t), DRM_MEM_DRIVER);
if (dev_priv == NULL)
@@ -109,13 +110,22 @@ int via_driver_load(drm_device_t *dev, unsigned long chipset)
if (chipset == VIA_PRO_GROUP_A)
dev_priv->pro_group_a = 1;
- return 0;
+#ifdef VIA_HAVE_CORE_MM
+ ret = drm_sman_init(&dev_priv->sman, 2, 12, 8);
+ if (ret) {
+ drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER);
+ }
+#endif
+ return ret;
}
int via_driver_unload(drm_device_t *dev)
{
drm_via_private_t *dev_priv = dev->dev_private;
+#ifdef VIA_HAVE_CORE_MM
+ drm_sman_takedown(&dev_priv->sman);
+#endif
drm_free(dev_priv, sizeof(drm_via_private_t), DRM_MEM_DRIVER);
return 0;