50 #if defined(CONFIG_FB_SIS) || defined(CONFIG_FB_SIS_MODULE)
53 #define SIS_MM_ALIGN_SHIFT 0
54 #define SIS_MM_ALIGN_MASK 0
58 #define SIS_MM_ALIGN_SHIFT 4
59 #define SIS_MM_ALIGN_MASK ((1 << SIS_MM_ALIGN_SHIFT) - 1)
63 static int sis_fb_init(
struct drm_device *
dev,
void *
data,
struct drm_file *file_priv)
77 DRM_DEBUG(
"offset = %lu, size = %lu\n", fb->
offset, fb->
size);
97 (
"Attempt to allocate from uninitialized memory manager.\n");
115 #if defined(CONFIG_FB_SIS) || defined(CONFIG_FB_SIS_MODULE)
118 if (item->
req.size == 0)
120 offset = item->
req.offset;
146 mem->
offset = ((pool == 0) ?
149 mem->
free = user_key;
164 DRM_DEBUG(
"alloc %d, size = %ld, offset = %ld\n", pool, mem->
size,
170 static int sis_drm_free(
struct drm_device *dev,
void *data,
struct drm_file *file_priv)
185 if (drm_mm_node_allocated(&obj->
mm_node))
187 #if defined(CONFIG_FB_SIS) || defined(CONFIG_FB_SIS_MODULE)
193 DRM_DEBUG(
"free = 0x%lx\n", mem->
free);
198 static int sis_fb_alloc(
struct drm_device *dev,
void *data,
199 struct drm_file *file_priv)
201 return sis_drm_alloc(dev, file_priv, data,
VIDEO_TYPE);
204 static int sis_ioctl_agp_init(
struct drm_device *dev,
void *data,
205 struct drm_file *file_priv)
209 dev_priv = dev->dev_private;
218 DRM_DEBUG(
"offset = %lu, size = %lu\n", agp->
offset, agp->
size);
222 static int sis_ioctl_agp_alloc(
struct drm_device *dev,
void *data,
223 struct drm_file *file_priv)
226 return sis_drm_alloc(dev, file_priv, data,
AGP_TYPE);
229 static drm_local_map_t *sis_reg_init(
struct drm_device *dev)
231 struct drm_map_list *
entry;
232 drm_local_map_t *
map;
255 dev_priv->
mmio = sis_reg_init(dev);
257 DRM_ERROR(
"Could not find register map.\n");
276 for (i = 0; i < 4; ++
i) {
280 ((idle_reg & 0x80000000) != 0x80000000));
284 DRM_ERROR(
"Graphics engine idle timeout. "
285 "Disabling idle check\n");
319 struct drm_file *file)
324 if (!(file->minor->master && file->master->lock.hw_lock))
330 if (list_empty(&file_priv->
obj_list)) {
343 if (drm_mm_node_allocated(&entry->
mm_node))
345 #if defined(CONFIG_FB_SIS) || defined(CONFIG_FB_SIS_MODULE)
359 DRM_IOCTL_DEF_DRV(SIS_FB_ALLOC, sis_fb_alloc, DRM_AUTH),
360 DRM_IOCTL_DEF_DRV(SIS_FB_FREE, sis_drm_free, DRM_AUTH),
361 DRM_IOCTL_DEF_DRV(SIS_AGP_INIT, sis_ioctl_agp_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
362 DRM_IOCTL_DEF_DRV(SIS_AGP_ALLOC, sis_ioctl_agp_alloc, DRM_AUTH),
363 DRM_IOCTL_DEF_DRV(SIS_AGP_FREE, sis_drm_free, DRM_AUTH),
364 DRM_IOCTL_DEF_DRV(SIS_FB_INIT, sis_fb_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),