diff options
Diffstat (limited to 'drivers/gpu/drm/gma500/psb_drv.c')
-rw-r--r-- | drivers/gpu/drm/gma500/psb_drv.c | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index f14768f2b364..c34adf9d910a 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c | |||
@@ -60,6 +60,16 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { | |||
60 | /* Atom E620 */ | 60 | /* Atom E620 */ |
61 | { 0x8086, 0x4108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops}, | 61 | { 0x8086, 0x4108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops}, |
62 | #endif | 62 | #endif |
63 | #if defined(CONFIG_DRM_MEDFIELD) | ||
64 | {0x8086, 0x0130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
65 | {0x8086, 0x0131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
66 | {0x8086, 0x0132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
67 | {0x8086, 0x0133, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
68 | {0x8086, 0x0134, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
69 | {0x8086, 0x0135, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
70 | {0x8086, 0x0136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
71 | {0x8086, 0x0137, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops}, | ||
72 | #endif | ||
63 | #if defined(CONFIG_DRM_GMA3600) | 73 | #if defined(CONFIG_DRM_GMA3600) |
64 | { 0x8086, 0x0be0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, | 74 | { 0x8086, 0x0be0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, |
65 | { 0x8086, 0x0be1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, | 75 | { 0x8086, 0x0be1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, |
@@ -70,7 +80,7 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { | |||
70 | { 0x8086, 0x0be6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, | 80 | { 0x8086, 0x0be6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, |
71 | { 0x8086, 0x0be7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, | 81 | { 0x8086, 0x0be7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops}, |
72 | #endif | 82 | #endif |
73 | { 0, 0, 0} | 83 | { 0, } |
74 | }; | 84 | }; |
75 | MODULE_DEVICE_TABLE(pci, pciidlist); | 85 | MODULE_DEVICE_TABLE(pci, pciidlist); |
76 | 86 | ||
@@ -78,27 +88,27 @@ MODULE_DEVICE_TABLE(pci, pciidlist); | |||
78 | * Standard IOCTLs. | 88 | * Standard IOCTLs. |
79 | */ | 89 | */ |
80 | 90 | ||
81 | #define DRM_IOCTL_PSB_ADB \ | 91 | #define DRM_IOCTL_GMA_ADB \ |
82 | DRM_IOWR(DRM_GMA_ADB + DRM_COMMAND_BASE, uint32_t) | 92 | DRM_IOWR(DRM_GMA_ADB + DRM_COMMAND_BASE, uint32_t) |
83 | #define DRM_IOCTL_PSB_MODE_OPERATION \ | 93 | #define DRM_IOCTL_GMA_MODE_OPERATION \ |
84 | DRM_IOWR(DRM_GMA_MODE_OPERATION + DRM_COMMAND_BASE, \ | 94 | DRM_IOWR(DRM_GMA_MODE_OPERATION + DRM_COMMAND_BASE, \ |
85 | struct drm_psb_mode_operation_arg) | 95 | struct drm_psb_mode_operation_arg) |
86 | #define DRM_IOCTL_PSB_STOLEN_MEMORY \ | 96 | #define DRM_IOCTL_GMA_STOLEN_MEMORY \ |
87 | DRM_IOWR(DRM_GMA_STOLEN_MEMORY + DRM_COMMAND_BASE, \ | 97 | DRM_IOWR(DRM_GMA_STOLEN_MEMORY + DRM_COMMAND_BASE, \ |
88 | struct drm_psb_stolen_memory_arg) | 98 | struct drm_psb_stolen_memory_arg) |
89 | #define DRM_IOCTL_PSB_GAMMA \ | 99 | #define DRM_IOCTL_GMA_GAMMA \ |
90 | DRM_IOWR(DRM_GMA_GAMMA + DRM_COMMAND_BASE, \ | 100 | DRM_IOWR(DRM_GMA_GAMMA + DRM_COMMAND_BASE, \ |
91 | struct drm_psb_dpst_lut_arg) | 101 | struct drm_psb_dpst_lut_arg) |
92 | #define DRM_IOCTL_PSB_DPST_BL \ | 102 | #define DRM_IOCTL_GMA_DPST_BL \ |
93 | DRM_IOWR(DRM_GMA_DPST_BL + DRM_COMMAND_BASE, \ | 103 | DRM_IOWR(DRM_GMA_DPST_BL + DRM_COMMAND_BASE, \ |
94 | uint32_t) | 104 | uint32_t) |
95 | #define DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID \ | 105 | #define DRM_IOCTL_GMA_GET_PIPE_FROM_CRTC_ID \ |
96 | DRM_IOWR(DRM_GMA_GET_PIPE_FROM_CRTC_ID + DRM_COMMAND_BASE, \ | 106 | DRM_IOWR(DRM_GMA_GET_PIPE_FROM_CRTC_ID + DRM_COMMAND_BASE, \ |
97 | struct drm_psb_get_pipe_from_crtc_id_arg) | 107 | struct drm_psb_get_pipe_from_crtc_id_arg) |
98 | #define DRM_IOCTL_PSB_GEM_CREATE \ | 108 | #define DRM_IOCTL_GMA_GEM_CREATE \ |
99 | DRM_IOWR(DRM_GMA_GEM_CREATE + DRM_COMMAND_BASE, \ | 109 | DRM_IOWR(DRM_GMA_GEM_CREATE + DRM_COMMAND_BASE, \ |
100 | struct drm_psb_gem_create) | 110 | struct drm_psb_gem_create) |
101 | #define DRM_IOCTL_PSB_GEM_MMAP \ | 111 | #define DRM_IOCTL_GMA_GEM_MMAP \ |
102 | DRM_IOWR(DRM_GMA_GEM_MMAP + DRM_COMMAND_BASE, \ | 112 | DRM_IOWR(DRM_GMA_GEM_MMAP + DRM_COMMAND_BASE, \ |
103 | struct drm_psb_gem_mmap) | 113 | struct drm_psb_gem_mmap) |
104 | 114 | ||
@@ -113,22 +123,19 @@ static int psb_gamma_ioctl(struct drm_device *dev, void *data, | |||
113 | static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data, | 123 | static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data, |
114 | struct drm_file *file_priv); | 124 | struct drm_file *file_priv); |
115 | 125 | ||
116 | #define PSB_IOCTL_DEF(ioctl, func, flags) \ | ||
117 | [DRM_IOCTL_NR(ioctl) - DRM_COMMAND_BASE] = {ioctl, flags, func} | ||
118 | |||
119 | static struct drm_ioctl_desc psb_ioctls[] = { | 126 | static struct drm_ioctl_desc psb_ioctls[] = { |
120 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_ADB, psb_adb_ioctl, DRM_AUTH), | 127 | DRM_IOCTL_DEF_DRV(GMA_ADB, psb_adb_ioctl, DRM_AUTH), |
121 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_MODE_OPERATION, psb_mode_operation_ioctl, | 128 | DRM_IOCTL_DEF_DRV(GMA_MODE_OPERATION, psb_mode_operation_ioctl, |
122 | DRM_AUTH), | 129 | DRM_AUTH), |
123 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_STOLEN_MEMORY, psb_stolen_memory_ioctl, | 130 | DRM_IOCTL_DEF_DRV(GMA_STOLEN_MEMORY, psb_stolen_memory_ioctl, |
124 | DRM_AUTH), | 131 | DRM_AUTH), |
125 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_GAMMA, psb_gamma_ioctl, DRM_AUTH), | 132 | DRM_IOCTL_DEF_DRV(GMA_GAMMA, psb_gamma_ioctl, DRM_AUTH), |
126 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_DPST_BL, psb_dpst_bl_ioctl, DRM_AUTH), | 133 | DRM_IOCTL_DEF_DRV(GMA_DPST_BL, psb_dpst_bl_ioctl, DRM_AUTH), |
127 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID, | 134 | DRM_IOCTL_DEF_DRV(GMA_GET_PIPE_FROM_CRTC_ID, |
128 | psb_intel_get_pipe_from_crtc_id, 0), | 135 | psb_intel_get_pipe_from_crtc_id, 0), |
129 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_GEM_CREATE, psb_gem_create_ioctl, | 136 | DRM_IOCTL_DEF_DRV(GMA_GEM_CREATE, psb_gem_create_ioctl, |
130 | DRM_UNLOCKED | DRM_AUTH), | 137 | DRM_UNLOCKED | DRM_AUTH), |
131 | PSB_IOCTL_DEF(DRM_IOCTL_PSB_GEM_MMAP, psb_gem_mmap_ioctl, | 138 | DRM_IOCTL_DEF_DRV(GMA_GEM_MMAP, psb_gem_mmap_ioctl, |
132 | DRM_UNLOCKED | DRM_AUTH), | 139 | DRM_UNLOCKED | DRM_AUTH), |
133 | }; | 140 | }; |
134 | 141 | ||
@@ -268,10 +275,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) | |||
268 | { | 275 | { |
269 | struct drm_psb_private *dev_priv; | 276 | struct drm_psb_private *dev_priv; |
270 | unsigned long resource_start; | 277 | unsigned long resource_start; |
271 | struct psb_gtt *pg; | ||
272 | unsigned long irqflags; | 278 | unsigned long irqflags; |
273 | int ret = -ENOMEM; | 279 | int ret = -ENOMEM; |
274 | uint32_t tt_pages; | ||
275 | struct drm_connector *connector; | 280 | struct drm_connector *connector; |
276 | struct psb_intel_encoder *psb_intel_encoder; | 281 | struct psb_intel_encoder *psb_intel_encoder; |
277 | 282 | ||
@@ -283,6 +288,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) | |||
283 | dev_priv->dev = dev; | 288 | dev_priv->dev = dev; |
284 | dev->dev_private = (void *) dev_priv; | 289 | dev->dev_private = (void *) dev_priv; |
285 | 290 | ||
291 | pci_set_master(dev->pdev); | ||
292 | |||
286 | if (!IS_PSB(dev)) { | 293 | if (!IS_PSB(dev)) { |
287 | if (pci_enable_msi(dev->pdev)) | 294 | if (pci_enable_msi(dev->pdev)) |
288 | dev_warn(dev->dev, "Enabling MSI failed!\n"); | 295 | dev_warn(dev->dev, "Enabling MSI failed!\n"); |
@@ -327,12 +334,6 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset) | |||
327 | if (!dev_priv->mmu) | 334 | if (!dev_priv->mmu) |
328 | goto out_err; | 335 | goto out_err; |
329 | 336 | ||
330 | pg = &dev_priv->gtt; | ||
331 | |||
332 | tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ? | ||
333 | (pg->gatt_pages) : PSB_TT_PRIV0_PLIMIT; | ||
334 | |||
335 | |||
336 | dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0); | 337 | dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0); |
337 | if (!dev_priv->pf_pd) | 338 | if (!dev_priv->pf_pd) |
338 | goto out_err; | 339 | goto out_err; |
@@ -409,7 +410,7 @@ out_err: | |||
409 | return ret; | 410 | return ret; |
410 | } | 411 | } |
411 | 412 | ||
412 | int psb_driver_device_is_agp(struct drm_device *dev) | 413 | static int psb_driver_device_is_agp(struct drm_device *dev) |
413 | { | 414 | { |
414 | return 0; | 415 | return 0; |
415 | } | 416 | } |
@@ -600,7 +601,7 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd, | |||
600 | /* When a client dies: | 601 | /* When a client dies: |
601 | * - Check for and clean up flipped page state | 602 | * - Check for and clean up flipped page state |
602 | */ | 603 | */ |
603 | void psb_driver_preclose(struct drm_device *dev, struct drm_file *priv) | 604 | static void psb_driver_preclose(struct drm_device *dev, struct drm_file *priv) |
604 | { | 605 | { |
605 | } | 606 | } |
606 | 607 | ||
@@ -677,7 +678,9 @@ static struct pci_driver psb_pci_driver = { | |||
677 | .id_table = pciidlist, | 678 | .id_table = pciidlist, |
678 | .probe = psb_probe, | 679 | .probe = psb_probe, |
679 | .remove = psb_remove, | 680 | .remove = psb_remove, |
680 | .driver.pm = &psb_pm_ops, | 681 | .driver = { |
682 | .pm = &psb_pm_ops, | ||
683 | } | ||
681 | }; | 684 | }; |
682 | 685 | ||
683 | static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 686 | static int psb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |