Bug 14811 (NOUVEAU_wo_AGP) - case NOUVEAU_GART_AGP: not used, if not set CONFIG_AGP
Summary: case NOUVEAU_GART_AGP: not used, if not set CONFIG_AGP
Status: CLOSED OBSOLETE
Alias: NOUVEAU_wo_AGP
Product: Drivers
Classification: Unclassified
Component: Video(Other) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_video-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-14 20:18 UTC by Pavel Vasilyev
Modified: 2012-06-18 13:17 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.32-git10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
... and more (557 bytes, patch)
2009-12-14 20:19 UTC, Pavel Vasilyev
Details | Diff

Description Pavel Vasilyev 2009-12-14 20:18:17 UTC
static struct ttm_backend *
nouveau_bo_create_ttm_backend_entry(struct ttm_bo_device *bdev)
{
        struct drm_nouveau_private *dev_priv = nouveau_bdev(bdev);
        struct drm_device *dev = dev_priv->dev;

        switch (dev_priv->gart_info.type) {

        case NOUVEAU_GART_AGP:
                return ttm_agp_backend_init(bdev, dev->agp->bridge);
....

error: implicit declaration of function 'ttm_agp_backend_init'
warning: return makes pointer from integer without a cast


CONFIG_AGP is not set in my config
Comment 1 Pavel Vasilyev 2009-12-14 20:19:04 UTC
Created attachment 24188 [details]
... and more
Comment 2 Pavel Vasilyev 2009-12-14 20:47:57 UTC
(In reply to comment #1)
> Created an attachment (id=24188) [details]
> Patch

Additional, complete patch for system without AGP
Comment 3 Pavel Vasilyev 2009-12-14 20:51:02 UTC
Comment on attachment 24188 [details]
... and more

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 320a14b..25d3cb3 100644                                                           
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c                                              
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c                                              
@@ -311,8 +311,10 @@ nouveau_bo_create_ttm_backend_entry(struct ttm_bo_device *bdev)    
        struct drm_device *dev = dev_priv->dev;                                         
                                                                                        
        switch (dev_priv->gart_info.type) {                                             
+#ifdef CONFIG_AGP                                                                      
        case NOUVEAU_GART_AGP:                                                          
                return ttm_agp_backend_init(bdev, dev->agp->bridge);                    
+#endif                                                                                 
        case NOUVEAU_GART_SGDMA:                                                        
                return nouveau_sgdma_init_ttm(dev);                                     
        default:                                                                        
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c
index 35249c3..7b5fc47 100644                                                             
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c                                               
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c                                               
@@ -244,7 +244,7 @@ nouveau_pci_resume(struct pci_dev *pdev)                              
        ret = nouveau_run_vbios_init(dev);                                                
        if (ret)                                                                          
                return ret;                                                               
-                                                                                         
+#ifdef CONFIG_AGP
        if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) {
                ret = nouveau_mem_init_agp(dev);
                if (ret) {
@@ -252,6 +252,7 @@ nouveau_pci_resume(struct pci_dev *pdev)
                        return ret;
                }
        }
+#endif

        NV_INFO(dev, "Reinitialising engines...\n");
        engine->instmem.resume(dev);
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 88b4c7b..1679e73 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -680,7 +680,9 @@ extern void nouveau_mem_free_block(struct mem_block *);
 extern uint64_t nouveau_mem_fb_amount(struct drm_device *);
 extern void nouveau_mem_release(struct drm_file *, struct mem_block *heap);
 extern int  nouveau_mem_init(struct drm_device *);
+#ifdef CONFIG_AGP
 extern int  nouveau_mem_init_agp(struct drm_device *);
+#endif
 extern void nouveau_mem_close(struct drm_device *);
 extern int  nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt,
                                    uint32_t size, uint32_t flags,
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 0275571..f70d75d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -407,6 +407,7 @@ uint64_t nouveau_mem_fb_amount(struct drm_device *dev)
        return 0;
 }

+#ifdef CONFIG_AGP
 static void nouveau_mem_reset_agp(struct drm_device *dev)
 {
        uint32_t saved_pci_nv_1, saved_pci_nv_19, pmc_enable;
@@ -473,6 +474,7 @@ nouveau_mem_init_agp(struct drm_device *dev)
        dev_priv->gart_info.aper_size   = info.aperture_size;
        return 0;
 }
+#endif

 int
 nouveau_mem_init(struct drm_device *dev)
@@ -532,7 +534,7 @@ nouveau_mem_init(struct drm_device *dev)
        }

        /* GART */
-#if !defined(__powerpc__) && !defined(__ia64__)
+#if !defined(__powerpc__) && !defined(__ia64__) && defined(CONFIG_AGP)
        if (drm_device_is_agp(dev) && dev->agp) {
                ret = nouveau_mem_init_agp(dev);
                if (ret)
Comment 4 Pavel Vasilyev 2009-12-14 21:43:54 UTC
Comment on attachment 24188 [details]
... and more

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c                                                     
index 320a14b..86625d7 100644                                                                                                                
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c                                                                                                   
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c                                                                                                   
@@ -311,8 +311,10 @@ nouveau_bo_create_ttm_backend_entry(struct ttm_bo_device *bdev)                                                         
        struct drm_device *dev = dev_priv->dev;                                                                                              
                                                                                                                                             
        switch (dev_priv->gart_info.type) {                                                                                                  
+#ifdef CONFIG_AGP                                                                                                                           
        case NOUVEAU_GART_AGP:                                                                                                               
                return ttm_agp_backend_init(bdev, dev->agp->bridge);                                                                         
+#endif                                                                                                                                      
        case NOUVEAU_GART_SGDMA:                                                                                                             
                return nouveau_sgdma_init_ttm(dev);                                                                                          
        default:                                                                                                                             
@@ -362,12 +364,14 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,                                                    
                break;                                                                                                                       
        case TTM_PL_TT:                                                                                                                      
                switch (dev_priv->gart_info.type) {                                                                                          
+#ifdef CONFIG_AGP                                                                                                                           
                case NOUVEAU_GART_AGP:                                                                                                       
                        man->flags = TTM_MEMTYPE_FLAG_MAPPABLE |                                                                             
                                     TTM_MEMTYPE_FLAG_NEEDS_IOREMAP;                                                                         
                        man->available_caching = TTM_PL_FLAG_UNCACHED;                                                                       
                        man->default_caching = TTM_PL_FLAG_UNCACHED;                                                                         
                        break;                                                                                                               
+#endif                                                                                                                                      
                case NOUVEAU_GART_SGDMA:                                                                                                     
                        man->flags = TTM_MEMTYPE_FLAG_MAPPABLE |                                                                             
                                     TTM_MEMTYPE_FLAG_CMA;                                                                                   
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c                                                   
index 35249c3..7b5fc47 100644                                                                                                                
--- a/drivers/gpu/drm/nouveau/nouveau_drv.c                                                                                                  
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.c                                                                                                  
@@ -244,7 +244,7 @@ nouveau_pci_resume(struct pci_dev *pdev)                                                                                 
        ret = nouveau_run_vbios_init(dev);                                                                                                   
        if (ret)                                                                                                                             
                return ret;                                                                                                                  
-                                                                                                                                            
+#ifdef CONFIG_AGP                                                                                                                           
        if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) {                                                                                  
                ret = nouveau_mem_init_agp(dev);                                                                                             
                if (ret) {                                                                                                                   
@@ -252,6 +252,7 @@ nouveau_pci_resume(struct pci_dev *pdev)                                                                                 
                        return ret;                                                                                                          
                }                                                                                                                            
        }                                                                                                                                    
+#endif                                                                                                                                      
                                                                                                                                             
        NV_INFO(dev, "Reinitialising engines...\n");                                                                                         
        engine->instmem.resume(dev);                                                                                                         
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h                                                   
index 88b4c7b..d08000e 100644                                                                                                                
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h                                                                                                  
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h                                                                                                  
@@ -530,7 +530,9 @@ struct drm_nouveau_private {                                                                                             
        struct {                                                                                                                             
                enum {                                                                                                                       
                        NOUVEAU_GART_NONE = 0,                                                                                               
+#ifdef CONFIG_AGP                                                                                                                           
                        NOUVEAU_GART_AGP,                                                                                                    
+#endif                                                                                                                                      
                        NOUVEAU_GART_SGDMA                                                                                                   
                } type;                                                                                                                      
                uint64_t aper_base;                                                                                                          
@@ -637,7 +639,9 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)                                                        
 } while (0)                                                                                                                                 
                                                                                                                                             
 /* nouveau_drv.c */                                                                                                                         
+#ifdef CONFIG_AGP                                                                                                                           
 extern int nouveau_noagp;                                                                                                                   
+#endif                                                                                                                                      
 extern int nouveau_duallink;                                                                                                                
 extern int nouveau_uscript_lvds;                                                                                                            
 extern int nouveau_uscript_tmds;                                                                                                            
@@ -680,7 +684,9 @@ extern void nouveau_mem_free_block(struct mem_block *);                                                                  
 extern uint64_t nouveau_mem_fb_amount(struct drm_device *);                                                                                 
 extern void nouveau_mem_release(struct drm_file *, struct mem_block *heap);                                                                 
 extern int  nouveau_mem_init(struct drm_device *);                                                                                          
+#ifdef CONFIG_AGP                                                                                                                           
 extern int  nouveau_mem_init_agp(struct drm_device *);                                                                                      
+#endif                                                                                                                                      
 extern void nouveau_mem_close(struct drm_device *);                                                                                         
 extern int  nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt,                                                                     
                                    uint32_t size, uint32_t flags,                                                                           
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 0275571..f70d75d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -407,6 +407,7 @@ uint64_t nouveau_mem_fb_amount(struct drm_device *dev)
        return 0;
 }

+#ifdef CONFIG_AGP
 static void nouveau_mem_reset_agp(struct drm_device *dev)
 {
        uint32_t saved_pci_nv_1, saved_pci_nv_19, pmc_enable;
@@ -473,6 +474,7 @@ nouveau_mem_init_agp(struct drm_device *dev)
        dev_priv->gart_info.aper_size   = info.aperture_size;
        return 0;
 }
+#endif

 int
 nouveau_mem_init(struct drm_device *dev)
@@ -532,7 +534,7 @@ nouveau_mem_init(struct drm_device *dev)
        }

        /* GART */
-#if !defined(__powerpc__) && !defined(__ia64__)
+#if !defined(__powerpc__) && !defined(__ia64__) && defined(CONFIG_AGP)
        if (drm_device_is_agp(dev) && dev->agp) {
                ret = nouveau_mem_init_agp(dev);
                if (ret)
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 93379bb..085e5c0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -751,9 +751,10 @@ nouveau_gpuobj_gart_dma_new(struct nouveau_channel *chan,
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        int ret;

-       if (dev_priv->gart_info.type == NOUVEAU_GART_AGP ||
-           (dev_priv->card_type >= NV_50 &&
-            dev_priv->gart_info.type == NOUVEAU_GART_SGDMA)) {
+#ifdef CONFIG_AGP
+       if ( dev_priv->gart_info.type == NOUVEAU_GART_AGP   ||
+                              (dev_priv->card_type >= NV_50 &&
+            dev_priv->gart_info.type == NOUVEAU_GART_SGDMA)) {
                ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
                                             offset + dev_priv->vm_gart_base,
                                             size, access, NV_DMA_TARGET_AGP,
@@ -761,6 +762,7 @@ nouveau_gpuobj_gart_dma_new(struct nouveau_channel *chan,
                if (o_ret)
                        *o_ret = 0;
        } else
+#endif
        if (dev_priv->gart_info.type == NOUVEAU_GART_SGDMA) {
                *gpuobj = dev_priv->gart_info.sg_ctxdma;
                if (offset & ~0xffffffffULL) {
Comment 5 Pavel Vasilyev 2009-12-14 21:52:20 UTC
Or may be .... 

diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index d823e63..e7e3115 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -2,6 +2,7 @@ config DRM_NOUVEAU
        tristate "Nouveau (nVidia) cards"
        depends on DRM
         select FW_LOADER
+        select AGP
        select DRM_KMS_HELPER
        select DRM_TTM
        select FB_CFB_FILLRECT

But then I still will be forced to turn off AGP  :)
Comment 6 Pavel Vasilyev 2009-12-14 21:57:39 UTC
Sorry, ....

diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index d823e63..649c2fc 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -1,7 +1,7 @@
 config DRM_NOUVEAU
        tristate "Nouveau (nVidia) cards"
-       depends on DRM
         select FW_LOADER
+        select AGP
        select DRM_KMS_HELPER
        select DRM_TTM
        select FB_CFB_FILLRECT

Note You need to log in before you can comment on or make changes to this bug.