psb_drv.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. /**************************************************************************
  2. * Copyright (c) 2007-2011, Intel Corporation.
  3. * All Rights Reserved.
  4. * Copyright (c) 2008, Tungsten Graphics, Inc. Cedar Park, TX., USA.
  5. * All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. **************************************************************************/
  21. #include <drm/drmP.h>
  22. #include <drm/drm.h>
  23. #include "psb_drv.h"
  24. #include "framebuffer.h"
  25. #include "psb_reg.h"
  26. #include "psb_intel_reg.h"
  27. #include "intel_bios.h"
  28. #include "mid_bios.h"
  29. #include <drm/drm_pciids.h>
  30. #include "power.h"
  31. #include <linux/cpu.h>
  32. #include <linux/notifier.h>
  33. #include <linux/spinlock.h>
  34. #include <linux/pm_runtime.h>
  35. #include <acpi/video.h>
  36. #include <linux/module.h>
  37. #include <asm/set_memory.h>
  38. static struct drm_driver driver;
  39. static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
  40. /*
  41. * The table below contains a mapping of the PCI vendor ID and the PCI Device ID
  42. * to the different groups of PowerVR 5-series chip designs
  43. *
  44. * 0x8086 = Intel Corporation
  45. *
  46. * PowerVR SGX535 - Poulsbo - Intel GMA 500, Intel Atom Z5xx
  47. * PowerVR SGX535 - Moorestown - Intel GMA 600
  48. * PowerVR SGX535 - Oaktrail - Intel GMA 600, Intel Atom Z6xx, E6xx
  49. * PowerVR SGX540 - Medfield - Intel Atom Z2460
  50. * PowerVR SGX544MP2 - Medfield -
  51. * PowerVR SGX545 - Cedartrail - Intel GMA 3600, Intel Atom D2500, N2600
  52. * PowerVR SGX545 - Cedartrail - Intel GMA 3650, Intel Atom D2550, D2700,
  53. * N2800
  54. */
  55. static const struct pci_device_id pciidlist[] = {
  56. { 0x8086, 0x8108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops },
  57. { 0x8086, 0x8109, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops },
  58. #if defined(CONFIG_DRM_GMA600)
  59. { 0x8086, 0x4100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  60. { 0x8086, 0x4101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  61. { 0x8086, 0x4102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  62. { 0x8086, 0x4103, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  63. { 0x8086, 0x4104, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  64. { 0x8086, 0x4105, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  65. { 0x8086, 0x4106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  66. { 0x8086, 0x4107, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  67. { 0x8086, 0x4108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  68. #endif
  69. #if defined(CONFIG_DRM_MEDFIELD)
  70. { 0x8086, 0x0130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  71. { 0x8086, 0x0131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  72. { 0x8086, 0x0132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  73. { 0x8086, 0x0133, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  74. { 0x8086, 0x0134, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  75. { 0x8086, 0x0135, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  76. { 0x8086, 0x0136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  77. { 0x8086, 0x0137, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  78. #endif
  79. #if defined(CONFIG_DRM_GMA3600)
  80. { 0x8086, 0x0be0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  81. { 0x8086, 0x0be1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  82. { 0x8086, 0x0be2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  83. { 0x8086, 0x0be3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  84. { 0x8086, 0x0be4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  85. { 0x8086, 0x0be5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  86. { 0x8086, 0x0be6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  87. { 0x8086, 0x0be7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  88. { 0x8086, 0x0be8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  89. { 0x8086, 0x0be9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  90. { 0x8086, 0x0bea, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  91. { 0x8086, 0x0beb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  92. { 0x8086, 0x0bec, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  93. { 0x8086, 0x0bed, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  94. { 0x8086, 0x0bee, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  95. { 0x8086, 0x0bef, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  96. #endif
  97. { 0, }
  98. };
  99. MODULE_DEVICE_TABLE(pci, pciidlist);
  100. /*
  101. * Standard IOCTLs.
  102. */
  103. static const struct drm_ioctl_desc psb_ioctls[] = {
  104. };
  105. static int psb_do_init(struct drm_device *dev)
  106. {
  107. struct drm_psb_private *dev_priv = dev->dev_private;
  108. struct psb_gtt *pg = &dev_priv->gtt;
  109. uint32_t stolen_gtt;
  110. if (pg->mmu_gatt_start & 0x0FFFFFFF) {
  111. dev_err(dev->dev, "Gatt must be 256M aligned. This is a bug.\n");
  112. return -EINVAL;
  113. }
  114. stolen_gtt = (pg->stolen_size >> PAGE_SHIFT) * 4;
  115. stolen_gtt = (stolen_gtt + PAGE_SIZE - 1) >> PAGE_SHIFT;
  116. stolen_gtt = (stolen_gtt < pg->gtt_pages) ? stolen_gtt : pg->gtt_pages;
  117. dev_priv->gatt_free_offset = pg->mmu_gatt_start +
  118. (stolen_gtt << PAGE_SHIFT) * 1024;
  119. spin_lock_init(&dev_priv->irqmask_lock);
  120. spin_lock_init(&dev_priv->lock_2d);
  121. PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK0);
  122. PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK1);
  123. PSB_RSGX32(PSB_CR_BIF_BANK1);
  124. /* Do not bypass any MMU access, let them pagefault instead */
  125. PSB_WSGX32((PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_MMU_ER_MASK),
  126. PSB_CR_BIF_CTRL);
  127. PSB_RSGX32(PSB_CR_BIF_CTRL);
  128. psb_spank(dev_priv);
  129. /* mmu_gatt ?? */
  130. PSB_WSGX32(pg->gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
  131. PSB_RSGX32(PSB_CR_BIF_TWOD_REQ_BASE); /* Post */
  132. return 0;
  133. }
  134. static void psb_driver_unload(struct drm_device *dev)
  135. {
  136. struct drm_psb_private *dev_priv = dev->dev_private;
  137. /* TODO: Kill vblank etc here */
  138. if (dev_priv) {
  139. if (dev_priv->backlight_device)
  140. gma_backlight_exit(dev);
  141. psb_modeset_cleanup(dev);
  142. if (dev_priv->ops->chip_teardown)
  143. dev_priv->ops->chip_teardown(dev);
  144. psb_intel_opregion_fini(dev);
  145. if (dev_priv->pf_pd) {
  146. psb_mmu_free_pagedir(dev_priv->pf_pd);
  147. dev_priv->pf_pd = NULL;
  148. }
  149. if (dev_priv->mmu) {
  150. struct psb_gtt *pg = &dev_priv->gtt;
  151. down_read(&pg->sem);
  152. psb_mmu_remove_pfn_sequence(
  153. psb_mmu_get_default_pd
  154. (dev_priv->mmu),
  155. pg->mmu_gatt_start,
  156. dev_priv->vram_stolen_size >> PAGE_SHIFT);
  157. up_read(&pg->sem);
  158. psb_mmu_driver_takedown(dev_priv->mmu);
  159. dev_priv->mmu = NULL;
  160. }
  161. psb_gtt_takedown(dev);
  162. if (dev_priv->scratch_page) {
  163. set_pages_wb(dev_priv->scratch_page, 1);
  164. __free_page(dev_priv->scratch_page);
  165. dev_priv->scratch_page = NULL;
  166. }
  167. if (dev_priv->vdc_reg) {
  168. iounmap(dev_priv->vdc_reg);
  169. dev_priv->vdc_reg = NULL;
  170. }
  171. if (dev_priv->sgx_reg) {
  172. iounmap(dev_priv->sgx_reg);
  173. dev_priv->sgx_reg = NULL;
  174. }
  175. if (dev_priv->aux_reg) {
  176. iounmap(dev_priv->aux_reg);
  177. dev_priv->aux_reg = NULL;
  178. }
  179. pci_dev_put(dev_priv->aux_pdev);
  180. pci_dev_put(dev_priv->lpc_pdev);
  181. /* Destroy VBT data */
  182. psb_intel_destroy_bios(dev);
  183. kfree(dev_priv);
  184. dev->dev_private = NULL;
  185. }
  186. gma_power_uninit(dev);
  187. }
  188. static int psb_driver_load(struct drm_device *dev, unsigned long flags)
  189. {
  190. struct drm_psb_private *dev_priv;
  191. unsigned long resource_start, resource_len;
  192. unsigned long irqflags;
  193. int ret = -ENOMEM;
  194. struct drm_connector *connector;
  195. struct gma_encoder *gma_encoder;
  196. struct psb_gtt *pg;
  197. /* allocating and initializing driver private data */
  198. dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
  199. if (dev_priv == NULL)
  200. return -ENOMEM;
  201. dev_priv->ops = (struct psb_ops *)flags;
  202. dev_priv->dev = dev;
  203. dev->dev_private = (void *) dev_priv;
  204. pg = &dev_priv->gtt;
  205. pci_set_master(dev->pdev);
  206. dev_priv->num_pipe = dev_priv->ops->pipes;
  207. resource_start = pci_resource_start(dev->pdev, PSB_MMIO_RESOURCE);
  208. dev_priv->vdc_reg =
  209. ioremap(resource_start + PSB_VDC_OFFSET, PSB_VDC_SIZE);
  210. if (!dev_priv->vdc_reg)
  211. goto out_err;
  212. dev_priv->sgx_reg = ioremap(resource_start + dev_priv->ops->sgx_offset,
  213. PSB_SGX_SIZE);
  214. if (!dev_priv->sgx_reg)
  215. goto out_err;
  216. if (IS_MRST(dev)) {
  217. int domain = pci_domain_nr(dev->pdev->bus);
  218. dev_priv->aux_pdev =
  219. pci_get_domain_bus_and_slot(domain, 0,
  220. PCI_DEVFN(3, 0));
  221. if (dev_priv->aux_pdev) {
  222. resource_start = pci_resource_start(dev_priv->aux_pdev,
  223. PSB_AUX_RESOURCE);
  224. resource_len = pci_resource_len(dev_priv->aux_pdev,
  225. PSB_AUX_RESOURCE);
  226. dev_priv->aux_reg = ioremap_nocache(resource_start,
  227. resource_len);
  228. if (!dev_priv->aux_reg)
  229. goto out_err;
  230. DRM_DEBUG_KMS("Found aux vdc");
  231. } else {
  232. /* Couldn't find the aux vdc so map to primary vdc */
  233. dev_priv->aux_reg = dev_priv->vdc_reg;
  234. DRM_DEBUG_KMS("Couldn't find aux pci device");
  235. }
  236. dev_priv->gmbus_reg = dev_priv->aux_reg;
  237. dev_priv->lpc_pdev =
  238. pci_get_domain_bus_and_slot(domain, 0,
  239. PCI_DEVFN(31, 0));
  240. if (dev_priv->lpc_pdev) {
  241. pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
  242. &dev_priv->lpc_gpio_base);
  243. pci_write_config_dword(dev_priv->lpc_pdev, PSB_LPC_GBA,
  244. (u32)dev_priv->lpc_gpio_base | (1L<<31));
  245. pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
  246. &dev_priv->lpc_gpio_base);
  247. dev_priv->lpc_gpio_base &= 0xffc0;
  248. if (dev_priv->lpc_gpio_base)
  249. DRM_DEBUG_KMS("Found LPC GPIO at 0x%04x\n",
  250. dev_priv->lpc_gpio_base);
  251. else {
  252. pci_dev_put(dev_priv->lpc_pdev);
  253. dev_priv->lpc_pdev = NULL;
  254. }
  255. }
  256. } else {
  257. dev_priv->gmbus_reg = dev_priv->vdc_reg;
  258. }
  259. psb_intel_opregion_setup(dev);
  260. ret = dev_priv->ops->chip_setup(dev);
  261. if (ret)
  262. goto out_err;
  263. /* Init OSPM support */
  264. gma_power_init(dev);
  265. ret = -ENOMEM;
  266. dev_priv->scratch_page = alloc_page(GFP_DMA32 | __GFP_ZERO);
  267. if (!dev_priv->scratch_page)
  268. goto out_err;
  269. set_pages_uc(dev_priv->scratch_page, 1);
  270. ret = psb_gtt_init(dev, 0);
  271. if (ret)
  272. goto out_err;
  273. dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0);
  274. if (!dev_priv->mmu)
  275. goto out_err;
  276. dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0);
  277. if (!dev_priv->pf_pd)
  278. goto out_err;
  279. ret = psb_do_init(dev);
  280. if (ret)
  281. return ret;
  282. /* Add stolen memory to SGX MMU */
  283. down_read(&pg->sem);
  284. ret = psb_mmu_insert_pfn_sequence(psb_mmu_get_default_pd(dev_priv->mmu),
  285. dev_priv->stolen_base >> PAGE_SHIFT,
  286. pg->gatt_start,
  287. pg->stolen_size >> PAGE_SHIFT, 0);
  288. up_read(&pg->sem);
  289. psb_mmu_set_pd_context(psb_mmu_get_default_pd(dev_priv->mmu), 0);
  290. psb_mmu_set_pd_context(dev_priv->pf_pd, 1);
  291. PSB_WSGX32(0x20000000, PSB_CR_PDS_EXEC_BASE);
  292. PSB_WSGX32(0x30000000, PSB_CR_BIF_3D_REQ_BASE);
  293. acpi_video_register();
  294. /* Setup vertical blanking handling */
  295. ret = drm_vblank_init(dev, dev_priv->num_pipe);
  296. if (ret)
  297. goto out_err;
  298. /*
  299. * Install interrupt handlers prior to powering off SGX or else we will
  300. * crash.
  301. */
  302. dev_priv->vdc_irq_mask = 0;
  303. dev_priv->pipestat[0] = 0;
  304. dev_priv->pipestat[1] = 0;
  305. dev_priv->pipestat[2] = 0;
  306. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  307. PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
  308. PSB_WVDC32(0x00000000, PSB_INT_ENABLE_R);
  309. PSB_WVDC32(0xFFFFFFFF, PSB_INT_MASK_R);
  310. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  311. drm_irq_install(dev, dev->pdev->irq);
  312. dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
  313. dev->driver->get_vblank_counter = psb_get_vblank_counter;
  314. psb_modeset_init(dev);
  315. psb_fbdev_init(dev);
  316. drm_kms_helper_poll_init(dev);
  317. /* Only add backlight support if we have LVDS output */
  318. list_for_each_entry(connector, &dev->mode_config.connector_list,
  319. head) {
  320. gma_encoder = gma_attached_encoder(connector);
  321. switch (gma_encoder->type) {
  322. case INTEL_OUTPUT_LVDS:
  323. case INTEL_OUTPUT_MIPI:
  324. ret = gma_backlight_init(dev);
  325. break;
  326. }
  327. }
  328. if (ret)
  329. return ret;
  330. psb_intel_opregion_enable_asle(dev);
  331. #if 0
  332. /* Enable runtime pm at last */
  333. pm_runtime_enable(&dev->pdev->dev);
  334. pm_runtime_set_active(&dev->pdev->dev);
  335. #endif
  336. /* Intel drm driver load is done, continue doing pvr load */
  337. return 0;
  338. out_err:
  339. psb_driver_unload(dev);
  340. return ret;
  341. }
  342. static inline void get_brightness(struct backlight_device *bd)
  343. {
  344. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  345. if (bd) {
  346. bd->props.brightness = bd->ops->get_brightness(bd);
  347. backlight_update_status(bd);
  348. }
  349. #endif
  350. }
  351. static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,
  352. unsigned long arg)
  353. {
  354. struct drm_file *file_priv = filp->private_data;
  355. struct drm_device *dev = file_priv->minor->dev;
  356. struct drm_psb_private *dev_priv = dev->dev_private;
  357. static unsigned int runtime_allowed;
  358. if (runtime_allowed == 1 && dev_priv->is_lvds_on) {
  359. runtime_allowed++;
  360. pm_runtime_allow(&dev->pdev->dev);
  361. dev_priv->rpm_enabled = 1;
  362. }
  363. return drm_ioctl(filp, cmd, arg);
  364. /* FIXME: do we need to wrap the other side of this */
  365. }
  366. static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  367. {
  368. return drm_get_pci_dev(pdev, ent, &driver);
  369. }
  370. static void psb_pci_remove(struct pci_dev *pdev)
  371. {
  372. struct drm_device *dev = pci_get_drvdata(pdev);
  373. drm_put_dev(dev);
  374. }
  375. static const struct dev_pm_ops psb_pm_ops = {
  376. .resume = gma_power_resume,
  377. .suspend = gma_power_suspend,
  378. .thaw = gma_power_thaw,
  379. .freeze = gma_power_freeze,
  380. .restore = gma_power_restore,
  381. .runtime_suspend = psb_runtime_suspend,
  382. .runtime_resume = psb_runtime_resume,
  383. .runtime_idle = psb_runtime_idle,
  384. };
  385. static const struct vm_operations_struct psb_gem_vm_ops = {
  386. .fault = psb_gem_fault,
  387. .open = drm_gem_vm_open,
  388. .close = drm_gem_vm_close,
  389. };
  390. static const struct file_operations psb_gem_fops = {
  391. .owner = THIS_MODULE,
  392. .open = drm_open,
  393. .release = drm_release,
  394. .unlocked_ioctl = psb_unlocked_ioctl,
  395. .compat_ioctl = drm_compat_ioctl,
  396. .mmap = drm_gem_mmap,
  397. .poll = drm_poll,
  398. .read = drm_read,
  399. };
  400. static struct drm_driver driver = {
  401. .driver_features = DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | \
  402. DRIVER_MODESET | DRIVER_GEM,
  403. .load = psb_driver_load,
  404. .unload = psb_driver_unload,
  405. .lastclose = drm_fb_helper_lastclose,
  406. .num_ioctls = ARRAY_SIZE(psb_ioctls),
  407. .irq_preinstall = psb_irq_preinstall,
  408. .irq_postinstall = psb_irq_postinstall,
  409. .irq_uninstall = psb_irq_uninstall,
  410. .irq_handler = psb_irq_handler,
  411. .enable_vblank = psb_enable_vblank,
  412. .disable_vblank = psb_disable_vblank,
  413. .get_vblank_counter = psb_get_vblank_counter,
  414. .gem_free_object = psb_gem_free_object,
  415. .gem_vm_ops = &psb_gem_vm_ops,
  416. .dumb_create = psb_gem_dumb_create,
  417. .ioctls = psb_ioctls,
  418. .fops = &psb_gem_fops,
  419. .name = DRIVER_NAME,
  420. .desc = DRIVER_DESC,
  421. .date = DRIVER_DATE,
  422. .major = DRIVER_MAJOR,
  423. .minor = DRIVER_MINOR,
  424. .patchlevel = DRIVER_PATCHLEVEL
  425. };
  426. static struct pci_driver psb_pci_driver = {
  427. .name = DRIVER_NAME,
  428. .id_table = pciidlist,
  429. .probe = psb_pci_probe,
  430. .remove = psb_pci_remove,
  431. .driver.pm = &psb_pm_ops,
  432. };
  433. static int __init psb_init(void)
  434. {
  435. return pci_register_driver(&psb_pci_driver);
  436. }
  437. static void __exit psb_exit(void)
  438. {
  439. pci_unregister_driver(&psb_pci_driver);
  440. }
  441. late_initcall(psb_init);
  442. module_exit(psb_exit);
  443. MODULE_AUTHOR(DRIVER_AUTHOR);
  444. MODULE_DESCRIPTION(DRIVER_DESC);
  445. MODULE_LICENSE("GPL");