Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i810: drop device_is_agp callback

Use the same trick we used for i915 when we still had ums support:
Just initialize the agp support unconditionally in the driver load
function.

Unfortunately that means we need to export drm_agp_init again, but I
think that's a lesser evil.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-9-daniel.vetter@ffwll.ch

+10 -18
+2
drivers/gpu/drm/drm_agpsupport.c
··· 421 421 head->base = head->agp_info.aper_base; 422 422 return head; 423 423 } 424 + /* Only exported for i810.ko */ 425 + EXPORT_SYMBOL(drm_agp_init); 424 426 425 427 /** 426 428 * drm_legacy_agp_clear - Clear AGP resource list
+8 -16
drivers/gpu/drm/i810/i810_dma.c
··· 1190 1190 1191 1191 int i810_driver_load(struct drm_device *dev, unsigned long flags) 1192 1192 { 1193 + dev->agp = drm_agp_init(dev); 1194 + if (dev->agp) { 1195 + dev->agp->agp_mtrr = arch_phys_wc_add( 1196 + dev->agp->agp_info.aper_base, 1197 + dev->agp->agp_info.aper_size * 1198 + 1024 * 1024); 1199 + } 1200 + 1193 1201 /* Our userspace depends upon the agp mapping support. */ 1194 1202 if (!dev->agp) 1195 1203 return -EINVAL; ··· 1257 1249 }; 1258 1250 1259 1251 int i810_max_ioctl = ARRAY_SIZE(i810_ioctls); 1260 - 1261 - /** 1262 - * Determine if the device really is AGP or not. 1263 - * 1264 - * All Intel graphics chipsets are treated as AGP, even if they are really 1265 - * PCI-e. 1266 - * 1267 - * \param dev The device to be tested. 1268 - * 1269 - * \returns 1270 - * A value of 1 is always retured to indictate every i810 is AGP. 1271 - */ 1272 - int i810_driver_device_is_agp(struct drm_device *dev) 1273 - { 1274 - return 1; 1275 - }
-1
drivers/gpu/drm/i810/i810_drv.c
··· 60 60 .lastclose = i810_driver_lastclose, 61 61 .preclose = i810_driver_preclose, 62 62 .set_busid = drm_pci_set_busid, 63 - .device_is_agp = i810_driver_device_is_agp, 64 63 .dma_quiescent = i810_driver_dma_quiescent, 65 64 .ioctls = i810_ioctls, 66 65 .fops = &i810_driver_fops,
-1
drivers/gpu/drm/i810/i810_drv.h
··· 124 124 extern void i810_driver_lastclose(struct drm_device *dev); 125 125 extern void i810_driver_preclose(struct drm_device *dev, 126 126 struct drm_file *file_priv); 127 - extern int i810_driver_device_is_agp(struct drm_device *dev); 128 127 129 128 extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 130 129 extern const struct drm_ioctl_desc i810_ioctls[];