diff options
author | Dave Airlie <airlied@gmail.com> | 2010-12-14 12:16:38 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-06 22:09:36 -0500 |
commit | 8410ea3b95d105a5be5db501656f44bbb91197c1 (patch) | |
tree | 6cd27f207e50c13ba2f4a78d6323bc23f751e380 /drivers/gpu/drm/drm_stub.c | |
parent | ff72145badb834e8051719ea66e024784d000cb4 (diff) |
drm: rework PCI/platform driver interface.
This abstracts the pci/platform interface out a step further,
we can go further but this is far enough for now to allow USB
to be plugged in.
The drivers now just call the init code directly for their
device type.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index d59edc18301f..0bf2c773c6c5 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -269,25 +269,14 @@ int drm_fill_in_dev(struct drm_device *dev, | |||
269 | 269 | ||
270 | dev->driver = driver; | 270 | dev->driver = driver; |
271 | 271 | ||
272 | if (drm_core_has_AGP(dev)) { | 272 | if (dev->driver->bus->agp_init) { |
273 | if (drm_device_is_agp(dev)) | 273 | retcode = dev->driver->bus->agp_init(dev); |
274 | dev->agp = drm_agp_init(dev); | 274 | if (retcode) |
275 | if (drm_core_check_feature(dev, DRIVER_REQUIRE_AGP) | ||
276 | && (dev->agp == NULL)) { | ||
277 | DRM_ERROR("Cannot initialize the agpgart module.\n"); | ||
278 | retcode = -EINVAL; | ||
279 | goto error_out_unreg; | 275 | goto error_out_unreg; |
280 | } | ||
281 | if (drm_core_has_MTRR(dev)) { | ||
282 | if (dev->agp) | ||
283 | dev->agp->agp_mtrr = | ||
284 | mtrr_add(dev->agp->agp_info.aper_base, | ||
285 | dev->agp->agp_info.aper_size * | ||
286 | 1024 * 1024, MTRR_TYPE_WRCOMB, 1); | ||
287 | } | ||
288 | } | 276 | } |
289 | 277 | ||
290 | 278 | ||
279 | |||
291 | retcode = drm_ctxbitmap_init(dev); | 280 | retcode = drm_ctxbitmap_init(dev); |
292 | if (retcode) { | 281 | if (retcode) { |
293 | DRM_ERROR("Cannot allocate memory for context bitmap.\n"); | 282 | DRM_ERROR("Cannot allocate memory for context bitmap.\n"); |
@@ -425,7 +414,6 @@ int drm_put_minor(struct drm_minor **minor_p) | |||
425 | * | 414 | * |
426 | * Cleans up all DRM device, calling drm_lastclose(). | 415 | * Cleans up all DRM device, calling drm_lastclose(). |
427 | * | 416 | * |
428 | * \sa drm_init | ||
429 | */ | 417 | */ |
430 | void drm_put_dev(struct drm_device *dev) | 418 | void drm_put_dev(struct drm_device *dev) |
431 | { | 419 | { |