Loading drivers/gpu/drm/nouveau/nouveau_drv.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -393,7 +393,9 @@ static struct drm_driver driver = { .firstopen = nouveau_firstopen, .firstopen = nouveau_firstopen, .lastclose = nouveau_lastclose, .lastclose = nouveau_lastclose, .unload = nouveau_unload, .unload = nouveau_unload, .open = nouveau_open, .preclose = nouveau_preclose, .preclose = nouveau_preclose, .postclose = nouveau_postclose, #if defined(CONFIG_DRM_NOUVEAU_DEBUG) #if defined(CONFIG_DRM_NOUVEAU_DEBUG) .debugfs_init = nouveau_debugfs_init, .debugfs_init = nouveau_debugfs_init, .debugfs_cleanup = nouveau_debugfs_takedown, .debugfs_cleanup = nouveau_debugfs_takedown, Loading drivers/gpu/drm/nouveau/nouveau_drv.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -46,9 +46,15 @@ #include "ttm/ttm_module.h" #include "ttm/ttm_module.h" struct nouveau_fpriv { struct nouveau_fpriv { struct ttm_object_file *tfile; spinlock_t lock; }; }; static inline struct nouveau_fpriv * nouveau_fpriv(struct drm_file *file_priv) { return file_priv ? file_priv->driver_priv : NULL; } #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) #include "nouveau_drm.h" #include "nouveau_drm.h" Loading Loading @@ -792,7 +798,9 @@ extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state); extern int nouveau_pci_resume(struct pci_dev *pdev); extern int nouveau_pci_resume(struct pci_dev *pdev); /* nouveau_state.c */ /* nouveau_state.c */ extern int nouveau_open(struct drm_device *, struct drm_file *); extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern void nouveau_postclose(struct drm_device *, struct drm_file *); extern int nouveau_load(struct drm_device *, unsigned long flags); extern int nouveau_load(struct drm_device *, unsigned long flags); extern int nouveau_firstopen(struct drm_device *); extern int nouveau_firstopen(struct drm_device *); extern void nouveau_lastclose(struct drm_device *); extern void nouveau_lastclose(struct drm_device *); Loading drivers/gpu/drm/nouveau/nouveau_state.c +21 −0 Original line number Original line Diff line number Diff line Loading @@ -764,6 +764,20 @@ static void nouveau_card_takedown(struct drm_device *dev) vga_client_register(dev->pdev, NULL, NULL, NULL); vga_client_register(dev->pdev, NULL, NULL, NULL); } } int nouveau_open(struct drm_device *dev, struct drm_file *file_priv) { struct nouveau_fpriv *fpriv; fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); if (unlikely(!fpriv)) return -ENOMEM; spin_lock_init(&fpriv->lock); file_priv->driver_priv = fpriv; return 0; } /* here a client dies, release the stuff that was allocated for its /* here a client dies, release the stuff that was allocated for its * file_priv */ * file_priv */ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) Loading @@ -771,6 +785,13 @@ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) nouveau_channel_cleanup(dev, file_priv); nouveau_channel_cleanup(dev, file_priv); } } void nouveau_postclose(struct drm_device *dev, struct drm_file *file_priv) { struct nouveau_fpriv *fpriv = nouveau_fpriv(file_priv); kfree(fpriv); } /* first module load, setup the mmio/fb mapping */ /* first module load, setup the mmio/fb mapping */ /* KMS: we need mmio at load time, not when the first drm client opens. */ /* KMS: we need mmio at load time, not when the first drm client opens. */ int nouveau_firstopen(struct drm_device *dev) int nouveau_firstopen(struct drm_device *dev) Loading Loading
drivers/gpu/drm/nouveau/nouveau_drv.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -393,7 +393,9 @@ static struct drm_driver driver = { .firstopen = nouveau_firstopen, .firstopen = nouveau_firstopen, .lastclose = nouveau_lastclose, .lastclose = nouveau_lastclose, .unload = nouveau_unload, .unload = nouveau_unload, .open = nouveau_open, .preclose = nouveau_preclose, .preclose = nouveau_preclose, .postclose = nouveau_postclose, #if defined(CONFIG_DRM_NOUVEAU_DEBUG) #if defined(CONFIG_DRM_NOUVEAU_DEBUG) .debugfs_init = nouveau_debugfs_init, .debugfs_init = nouveau_debugfs_init, .debugfs_cleanup = nouveau_debugfs_takedown, .debugfs_cleanup = nouveau_debugfs_takedown, Loading
drivers/gpu/drm/nouveau/nouveau_drv.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -46,9 +46,15 @@ #include "ttm/ttm_module.h" #include "ttm/ttm_module.h" struct nouveau_fpriv { struct nouveau_fpriv { struct ttm_object_file *tfile; spinlock_t lock; }; }; static inline struct nouveau_fpriv * nouveau_fpriv(struct drm_file *file_priv) { return file_priv ? file_priv->driver_priv : NULL; } #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT) #include "nouveau_drm.h" #include "nouveau_drm.h" Loading Loading @@ -792,7 +798,9 @@ extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state); extern int nouveau_pci_resume(struct pci_dev *pdev); extern int nouveau_pci_resume(struct pci_dev *pdev); /* nouveau_state.c */ /* nouveau_state.c */ extern int nouveau_open(struct drm_device *, struct drm_file *); extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern void nouveau_postclose(struct drm_device *, struct drm_file *); extern int nouveau_load(struct drm_device *, unsigned long flags); extern int nouveau_load(struct drm_device *, unsigned long flags); extern int nouveau_firstopen(struct drm_device *); extern int nouveau_firstopen(struct drm_device *); extern void nouveau_lastclose(struct drm_device *); extern void nouveau_lastclose(struct drm_device *); Loading
drivers/gpu/drm/nouveau/nouveau_state.c +21 −0 Original line number Original line Diff line number Diff line Loading @@ -764,6 +764,20 @@ static void nouveau_card_takedown(struct drm_device *dev) vga_client_register(dev->pdev, NULL, NULL, NULL); vga_client_register(dev->pdev, NULL, NULL, NULL); } } int nouveau_open(struct drm_device *dev, struct drm_file *file_priv) { struct nouveau_fpriv *fpriv; fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); if (unlikely(!fpriv)) return -ENOMEM; spin_lock_init(&fpriv->lock); file_priv->driver_priv = fpriv; return 0; } /* here a client dies, release the stuff that was allocated for its /* here a client dies, release the stuff that was allocated for its * file_priv */ * file_priv */ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) Loading @@ -771,6 +785,13 @@ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) nouveau_channel_cleanup(dev, file_priv); nouveau_channel_cleanup(dev, file_priv); } } void nouveau_postclose(struct drm_device *dev, struct drm_file *file_priv) { struct nouveau_fpriv *fpriv = nouveau_fpriv(file_priv); kfree(fpriv); } /* first module load, setup the mmio/fb mapping */ /* first module load, setup the mmio/fb mapping */ /* KMS: we need mmio at load time, not when the first drm client opens. */ /* KMS: we need mmio at load time, not when the first drm client opens. */ int nouveau_firstopen(struct drm_device *dev) int nouveau_firstopen(struct drm_device *dev) Loading