Skip to content

Commit

Permalink
drm/i810: drop device_is_agp callback
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Daniel Vetter committed Jan 26, 2017
1 parent aec9746 commit 49d66d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/drm_agpsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
head->base = head->agp_info.aper_base;
return head;
}
/* Only exported for i810.ko */
EXPORT_SYMBOL(drm_agp_init);

/**
* drm_legacy_agp_clear - Clear AGP resource list
Expand Down
24 changes: 8 additions & 16 deletions drivers/gpu/drm/i810/i810_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,14 @@ static int i810_flip_bufs(struct drm_device *dev, void *data,

int i810_driver_load(struct drm_device *dev, unsigned long flags)
{
dev->agp = drm_agp_init(dev);
if (dev->agp) {
dev->agp->agp_mtrr = arch_phys_wc_add(
dev->agp->agp_info.aper_base,
dev->agp->agp_info.aper_size *
1024 * 1024);
}

/* Our userspace depends upon the agp mapping support. */
if (!dev->agp)
return -EINVAL;
Expand Down Expand Up @@ -1249,19 +1257,3 @@ const struct drm_ioctl_desc i810_ioctls[] = {
};

int i810_max_ioctl = ARRAY_SIZE(i810_ioctls);

/**
* Determine if the device really is AGP or not.
*
* All Intel graphics chipsets are treated as AGP, even if they are really
* PCI-e.
*
* \param dev The device to be tested.
*
* \returns
* A value of 1 is always retured to indictate every i810 is AGP.
*/
int i810_driver_device_is_agp(struct drm_device *dev)
{
return 1;
}
1 change: 0 additions & 1 deletion drivers/gpu/drm/i810/i810_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ static struct drm_driver driver = {
.lastclose = i810_driver_lastclose,
.preclose = i810_driver_preclose,
.set_busid = drm_pci_set_busid,
.device_is_agp = i810_driver_device_is_agp,
.dma_quiescent = i810_driver_dma_quiescent,
.ioctls = i810_ioctls,
.fops = &i810_driver_fops,
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i810/i810_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ extern int i810_driver_load(struct drm_device *, unsigned long flags);
extern void i810_driver_lastclose(struct drm_device *dev);
extern void i810_driver_preclose(struct drm_device *dev,
struct drm_file *file_priv);
extern int i810_driver_device_is_agp(struct drm_device *dev);

extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
extern const struct drm_ioctl_desc i810_ioctls[];
Expand Down

0 comments on commit 49d66d8

Please sign in to comment.