mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-26 00:40:12 +01:00
Better use of agp config option, and compile fixes when agp is not detected
This commit is contained in:
parent
a63f6b168c
commit
355f98bf25
5 changed files with 41 additions and 17 deletions
|
|
@ -86,7 +86,7 @@ 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 },
|
||||
|
||||
#ifdef DRM_AGP
|
||||
[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},
|
||||
|
|
@ -95,6 +95,7 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
|
|||
[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},
|
||||
#endif
|
||||
};
|
||||
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
|
||||
|
||||
|
|
@ -238,6 +239,7 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
|
||||
}
|
||||
#ifdef DRM_AGP
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
drm_agp_mem_t *temp;
|
||||
|
|
@ -254,7 +256,7 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Clear vma list (only built for debugging) */
|
||||
if (dev->vmalist) {
|
||||
for (vma = dev->vmalist; vma; vma = vma_next) {
|
||||
|
|
@ -339,8 +341,9 @@ int tdfx_init(void)
|
|||
|
||||
drm_mem_init();
|
||||
drm_proc_init(dev);
|
||||
#ifdef DRM_AGP
|
||||
dev->agp = drm_agp_init();
|
||||
|
||||
#endif
|
||||
if((retcode = drm_ctxbitmap_init(dev))) {
|
||||
DRM_ERROR("Cannot allocate memory for context bitmap.\n");
|
||||
drm_proc_cleanup();
|
||||
|
|
|
|||
|
|
@ -34,13 +34,12 @@
|
|||
|
||||
# **** End of SMP/MODVERSIONS detection
|
||||
|
||||
MODS= gamma.o tdfx.o mga.o i810.o
|
||||
MODS= gamma.o tdfx.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.o \
|
||||
agpsupport.o
|
||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
|
||||
DRMHEADERS= drm.h drmP.h
|
||||
|
||||
GAMMAOBJS= gamma_drv.o gamma_dma.o
|
||||
|
|
@ -49,12 +48,6 @@ GAMMAHEADERS= gamma_drv.h $(DRMHEADERS)
|
|||
TDFXOBJS= tdfx_drv.o tdfx_context.o
|
||||
TDFXHEADERS= tdfx_drv.h $(DRMHEADERS)
|
||||
|
||||
MGAOBJS= mga_drv.o mga_dma.o mga_bufs.o mga_state.o mga_context.o
|
||||
MGAHEADERS= mga_drv.h mga_drm_public.h $(DRMHEADERS)
|
||||
|
||||
I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
|
||||
I810HEADERS= i810_drv.h i810_drm_public.h $(DRMHEADERS)
|
||||
|
||||
PROGOBJS= drmstat.po xf86drm.po xf86drmHash.po xf86drmRandom.po sigio.po
|
||||
PROGHEADERS= xf86drm.h $(DRMHEADERS)
|
||||
|
||||
|
|
@ -116,9 +109,13 @@ MODVERSIONS := $(shell gcc -E -I $(TREE) picker.c 2>/dev/null \
|
|||
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
|
||||
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
|
||||
| grep -s 'AGP = ' | cut -d' ' -f3)
|
||||
ifeq ($(AGP),0)
|
||||
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
|
||||
| grep -s 'AGP_MODULE = ' | cut -d' ' -f3)
|
||||
endif
|
||||
all::;@echo KERNEL HEADERS IN $(TREE): SMP=${SMP} MODVERSIONS=${MODVERSIONS} \
|
||||
AGP=${AGP}
|
||||
all:: $(LIBS) $(MODS) $(PROGS)
|
||||
all:: $(LIBS) $(MODS)
|
||||
endif
|
||||
|
||||
# **** End of SMP/MODVERSIONS detection
|
||||
|
|
@ -132,8 +129,18 @@ MODCFLAGS += -DMODVERSIONS -include $(TREE)/linux/modversions.h
|
|||
endif
|
||||
ifeq ($(AGP),1)
|
||||
MODCFLAGS += -DDRM_AGP
|
||||
DRMOBJS += agpsupport.o
|
||||
MODS += mga.o i810.o
|
||||
|
||||
MGAOBJS= mga_drv.o mga_dma.o mga_bufs.o mga_state.o mga_context.o
|
||||
MGAHEADERS= mga_drv.h mga_drm_public.h $(DRMHEADERS)
|
||||
|
||||
I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
|
||||
I810HEADERS= i810_drv.h i810_drm_public.h $(DRMHEADERS)
|
||||
endif
|
||||
|
||||
all:: $(LIBS) $(MODS) $(PROGS)
|
||||
|
||||
# **** End of configuration
|
||||
|
||||
libdrm.a: $(DRMOBJS)
|
||||
|
|
@ -146,11 +153,13 @@ gamma.o: $(GAMMAOBJS) $(LIBS)
|
|||
tdfx.o: $(TDFXOBJS) $(LIBS)
|
||||
$(LD) -r $^ -o $@
|
||||
|
||||
ifeq ($(AGP),1)
|
||||
mga.o: $(MGAOBJS) $(LIBS)
|
||||
$(LD) -r $^ -o $@
|
||||
|
||||
i810.o: $(I810OBJS) $(LIBS)
|
||||
$(LD) -r $^ -o $@
|
||||
endif
|
||||
|
||||
drmstat: $(PROGOBJS)
|
||||
$(CC) $(PRGCFLAGS) $^ $(PRGLIBS) -o $@
|
||||
|
|
@ -173,8 +182,10 @@ ChangeLog:
|
|||
$(DRMOBJS): $(DRMHEADERS)
|
||||
$(GAMMAOBJS): $(GAMMAHEADERS)
|
||||
$(TDFXOBJS): $(TDFXHEADERS)
|
||||
ifeq ($(AGP),1)
|
||||
$(MGAOBJS): $(MGAHEADERS)
|
||||
$(I810OBJS): $(I810HEADERS)
|
||||
endif
|
||||
$(PROGOBJS): $(PROGHEADERS)
|
||||
|
||||
clean:
|
||||
|
|
|
|||
|
|
@ -103,9 +103,11 @@ int drm_addmap(struct inode *inode, struct file *filp, unsigned int cmd,
|
|||
dev->lock.hw_lock = map->handle; /* Pointer to lock */
|
||||
}
|
||||
break;
|
||||
#ifdef DRM_AGP
|
||||
case _DRM_AGP:
|
||||
map->offset = map->offset + dev->agp->base;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
drm_free(map, sizeof(*map), DRM_MEM_MAPS);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,12 @@
|
|||
#define CONFIG_AGP_MODULE 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_AGP
|
||||
#define CONFIG_AGP 0
|
||||
#endif
|
||||
|
||||
SMP = CONFIG_SMP
|
||||
MODVERSIONS = CONFIG_MODVERSIONS
|
||||
AGP = CONFIG_AGP_MODULE
|
||||
AGP = CONFIG_AGP
|
||||
AGP_MODULE = CONFIG_AGP_MODULE
|
||||
RELEASE = UTS_RELEASE
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ 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 },
|
||||
|
||||
#ifdef DRM_AGP
|
||||
[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},
|
||||
|
|
@ -95,6 +95,7 @@ static drm_ioctl_desc_t tdfx_ioctls[] = {
|
|||
[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},
|
||||
#endif
|
||||
};
|
||||
#define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
|
||||
|
||||
|
|
@ -238,6 +239,7 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
}
|
||||
dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
|
||||
}
|
||||
#ifdef DRM_AGP
|
||||
/* Clear AGP information */
|
||||
if (dev->agp) {
|
||||
drm_agp_mem_t *temp;
|
||||
|
|
@ -254,7 +256,7 @@ static int tdfx_takedown(drm_device_t *dev)
|
|||
drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
|
||||
dev->agp = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Clear vma list (only built for debugging) */
|
||||
if (dev->vmalist) {
|
||||
for (vma = dev->vmalist; vma; vma = vma_next) {
|
||||
|
|
@ -339,8 +341,9 @@ int tdfx_init(void)
|
|||
|
||||
drm_mem_init();
|
||||
drm_proc_init(dev);
|
||||
#ifdef DRM_AGP
|
||||
dev->agp = drm_agp_init();
|
||||
|
||||
#endif
|
||||
if((retcode = drm_ctxbitmap_init(dev))) {
|
||||
DRM_ERROR("Cannot allocate memory for context bitmap.\n");
|
||||
drm_proc_cleanup();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue