mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 01:58:02 +02:00
Fixes to make things compile
This commit is contained in:
parent
19e909f24e
commit
0f8f8fecca
13 changed files with 146 additions and 11 deletions
|
|
@ -13,7 +13,8 @@
|
|||
L_TARGET := libdrm.a
|
||||
|
||||
L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o \
|
||||
agpsupport.o
|
||||
|
||||
M_OBJS :=
|
||||
|
||||
|
|
@ -29,6 +30,10 @@ ifdef CONFIG_DRM_MGA
|
|||
M_OBJS += mga.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRM_R128
|
||||
M_OBJS += r128.o
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/Rules.make
|
||||
|
||||
gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET)
|
||||
|
|
@ -37,6 +42,9 @@ gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET)
|
|||
tdfx.o: tdfx_drv.o tdfx_context.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o -L. -ldrm
|
||||
|
||||
r128.o: r128_drv.o r128_context.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_context.o -L. -ldrm
|
||||
|
||||
mga.o: mga_drv.o mga_context.o mga_dma.o mga_bufs.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ mga_drv.o mga_context.o mga_bufs.o mga_dma.o -L. -ldrm
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#ifndef _DRM_P_H_
|
||||
#define _DRM_P_H_
|
||||
|
||||
#define DRM_AGP 1
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ EXPORT_SYMBOL(mga_cleanup);
|
|||
#define MGA_PATCHLEVEL 1
|
||||
|
||||
static drm_device_t mga_device;
|
||||
drm_ctx_t mga_res_ctx;
|
||||
|
||||
static struct file_operations mga_fops = {
|
||||
open: mga_open,
|
||||
|
|
@ -88,7 +89,9 @@ static drm_ioctl_desc_t mga_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] = { mga_resctx, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] = { drm_adddraw, 1, 1 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)] = { drm_rmdraw, 1, 1 },
|
||||
#if 0
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { mga_dma, 1, 0 },
|
||||
#endif
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { mga_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { mga_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
|
@ -250,7 +253,17 @@ static int mga_takedown(drm_device_t *dev)
|
|||
}
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,15 @@ static drm_ioctl_desc_t r128_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { r128_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { r128_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_unbind, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_bind, 1, 1},
|
||||
};
|
||||
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
|
||||
|
||||
|
|
@ -231,7 +240,17 @@ static int r128_takedown(drm_device_t *dev)
|
|||
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,15 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { tdfx_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { tdfx_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_unbind, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_bind, 1, 1},
|
||||
};
|
||||
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
|
||||
|
||||
|
|
@ -231,7 +240,17 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@
|
|||
L_TARGET := libdrm.a
|
||||
|
||||
L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o \
|
||||
agpsupport.o
|
||||
|
||||
M_OBJS :=
|
||||
|
||||
|
|
@ -29,6 +30,10 @@ ifdef CONFIG_DRM_MGA
|
|||
M_OBJS += mga.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRM_R128
|
||||
M_OBJS += r128.o
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/Rules.make
|
||||
|
||||
gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET)
|
||||
|
|
@ -37,6 +42,9 @@ gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET)
|
|||
tdfx.o: tdfx_drv.o tdfx_context.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o -L. -ldrm
|
||||
|
||||
r128.o: r128_drv.o r128_context.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_context.o -L. -ldrm
|
||||
|
||||
mga.o: mga_drv.o mga_context.o mga_dma.o mga_bufs.o $(L_TARGET)
|
||||
$(LD) $(LD_RFLAG) -r -o $@ mga_drv.o mga_context.o mga_bufs.o mga_dma.o -L. -ldrm
|
||||
|
||||
|
|
|
|||
|
|
@ -56,12 +56,13 @@ MODVERSIONS := $(shell \
|
|||
|
||||
# **** End of SMP/MODVERSIONS detection
|
||||
|
||||
MODS= gamma.o tdfx.o mga.o
|
||||
MODS= gamma.o tdfx.o mga.o r128.o
|
||||
LIBS= libdrm.a
|
||||
PROGS= drmstat
|
||||
|
||||
DRMOBJS= init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.c
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o \
|
||||
agpsupport.o
|
||||
DRMHEADERS= drm.h drmP.h
|
||||
|
||||
GAMMAOBJS= gamma_drv.o gamma_dma.o
|
||||
|
|
@ -70,9 +71,12 @@ GAMMAHEADERS= gamma_drv.h $(DRMHEADERS)
|
|||
TDFXOBJS= tdfx_drv.o tdfx_context.o
|
||||
TDFXHEADERS= tdfx_drv.h $(DRMHEADERS)
|
||||
|
||||
MGAOBJS= mga_drv.o mga_context.o mga_dma.o mga_bufs.o
|
||||
MGAOBJS= mga_drv.o mga_context.o mga_bufs.o
|
||||
MGAHEADERS= mga_drv.h $(DRMHEADERS)
|
||||
|
||||
R128OBJS= r128_drv.o r128_context.o
|
||||
R128HEADERS= r128_drv.h $(DRMHEADERS)
|
||||
|
||||
PROGOBJS= drmstat.po xf86drm.po xf86drmHash.po xf86drmRandom.po sigio.po
|
||||
PROGHEADERS= xf86drm.h $(DRMHEADERS)
|
||||
|
||||
|
|
@ -114,6 +118,9 @@ tdfx.o: $(TDFXOBJS) $(LIBS)
|
|||
mga.o: $(MGAOBJS) $(LIBS)
|
||||
$(LD) -r $^ -o $@
|
||||
|
||||
r128.o: $(R128OBJS) $(LIBS)
|
||||
$(LD) -r $^ -o $@
|
||||
|
||||
drmstat: $(PROGOBJS)
|
||||
$(CC) $(PRGCFLAGS) $^ $(PRGLIBS) -o $@
|
||||
|
||||
|
|
@ -136,6 +143,7 @@ $(DRMOBJS): $(DRMHEADERS)
|
|||
$(GAMMAOBJS): $(GAMMAHEADERS)
|
||||
$(TDFXOBJS): $(TDFXHEADERS)
|
||||
$(MGAOBJS): $(MGAHEADERS)
|
||||
$(R128OBJS): $(R128HEADERS)
|
||||
$(PROGOBJS): $(PROGHEADERS)
|
||||
|
||||
clean:
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define __NO_VERSION__
|
||||
#include "drmP.h"
|
||||
|
||||
void drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle)
|
||||
|
|
@ -59,6 +60,8 @@ int drm_ctxbitmap_next(drm_device_t *dev)
|
|||
|
||||
int drm_ctxbitmap_init(drm_device_t *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
dev->ctx_bitmap = (unsigned long *) drm_alloc(PAGE_SIZE * 4,
|
||||
DRM_MEM_CTXBITMAP);
|
||||
if(dev->ctx_bitmap == NULL) {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#ifndef _DRM_P_H_
|
||||
#define _DRM_P_H_
|
||||
|
||||
#define DRM_AGP 1
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ EXPORT_SYMBOL(mga_cleanup);
|
|||
#define MGA_PATCHLEVEL 1
|
||||
|
||||
static drm_device_t mga_device;
|
||||
drm_ctx_t mga_res_ctx;
|
||||
|
||||
static struct file_operations mga_fops = {
|
||||
open: mga_open,
|
||||
|
|
@ -88,7 +89,9 @@ static drm_ioctl_desc_t mga_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] = { mga_resctx, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] = { drm_adddraw, 1, 1 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)] = { drm_rmdraw, 1, 1 },
|
||||
#if 0
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { mga_dma, 1, 0 },
|
||||
#endif
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { mga_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { mga_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
|
@ -250,7 +253,17 @@ static int mga_takedown(drm_device_t *dev)
|
|||
}
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,15 @@ static drm_ioctl_desc_t r128_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { r128_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { r128_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_unbind, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_bind, 1, 1},
|
||||
};
|
||||
#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
|
||||
|
||||
|
|
@ -231,7 +240,17 @@ static int r128_takedown(drm_device_t *dev)
|
|||
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,6 +199,8 @@ int tdfx_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
int tdfx_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
drm_file_t *priv = filp->private_data;
|
||||
drm_device_t *dev = priv->dev;
|
||||
drm_ctx_t ctx;
|
||||
|
||||
copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,15 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
|
|||
[DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { tdfx_lock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { tdfx_unlock, 1, 0 },
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 },
|
||||
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_unbind, 1, 1},
|
||||
[DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_bind, 1, 1},
|
||||
};
|
||||
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
|
||||
|
||||
|
|
@ -231,7 +240,17 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
/* FIXME -- free other information, too */
|
||||
drm_agp_mem_t *temp;
|
||||
drm_agp_mem_t *temp_next;
|
||||
|
||||
temp = dev->agp->memory;
|
||||
while(temp != NULL) {
|
||||
temp_next = temp->next;
|
||||
drm_free_agp(temp->memory, temp->pages);
|
||||
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
|
||||
temp = temp_next;
|
||||
}
|
||||
if(dev->agp->acquired) (*drm_agp.release)();
|
||||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue