Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm/i915: Fix cursor physical address choice to match the 2D driver.
drm: stash AGP include under the do-we-have-AGP ifdef
drm: don't whine about not reading EDID data
drm/i915: hook up LVDS DPMS property
drm/i915: remove unnecessary debug output in KMS init
i915: fix freeing path for gem phys objects.
drm: create mode_config idr lock
drm: fix leak of device mappings since multi-master changes.

+44 -12
+2 -1
drivers/gpu/drm/drm_agpsupport.c
··· 33 33 34 34 #include "drmP.h" 35 35 #include <linux/module.h> 36 - #include <asm/agp.h> 37 36 38 37 #if __OS_HAS_AGP 38 + 39 + #include <asm/agp.h> 39 40 40 41 /** 41 42 * Get AGP information.
+9 -5
drivers/gpu/drm/drm_crtc.c
··· 194 194 * @type: object type 195 195 * 196 196 * LOCKING: 197 - * Caller must hold DRM mode_config lock. 198 197 * 199 198 * Create a unique identifier based on @ptr in @dev's identifier space. Used 200 199 * for tracking modes, CRTCs and connectors. ··· 208 209 int new_id = 0; 209 210 int ret; 210 211 211 - WARN(!mutex_is_locked(&dev->mode_config.mutex), 212 - "%s called w/o mode_config lock\n", __func__); 213 212 again: 214 213 if (idr_pre_get(&dev->mode_config.crtc_idr, GFP_KERNEL) == 0) { 215 214 DRM_ERROR("Ran out memory getting a mode number\n"); 216 215 return -EINVAL; 217 216 } 218 217 218 + mutex_lock(&dev->mode_config.idr_mutex); 219 219 ret = idr_get_new_above(&dev->mode_config.crtc_idr, obj, 1, &new_id); 220 + mutex_unlock(&dev->mode_config.idr_mutex); 220 221 if (ret == -EAGAIN) 221 222 goto again; 222 223 ··· 238 239 static void drm_mode_object_put(struct drm_device *dev, 239 240 struct drm_mode_object *object) 240 241 { 242 + mutex_lock(&dev->mode_config.idr_mutex); 241 243 idr_remove(&dev->mode_config.crtc_idr, object->id); 244 + mutex_unlock(&dev->mode_config.idr_mutex); 242 245 } 243 246 244 247 void *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type) 245 248 { 246 - struct drm_mode_object *obj; 249 + struct drm_mode_object *obj = NULL; 247 250 251 + mutex_lock(&dev->mode_config.idr_mutex); 248 252 obj = idr_find(&dev->mode_config.crtc_idr, id); 249 253 if (!obj || (obj->type != type) || (obj->id != id)) 250 - return NULL; 254 + obj = NULL; 255 + mutex_unlock(&dev->mode_config.idr_mutex); 251 256 252 257 return obj; 253 258 } ··· 789 786 void drm_mode_config_init(struct drm_device *dev) 790 787 { 791 788 mutex_init(&dev->mode_config.mutex); 789 + mutex_init(&dev->mode_config.idr_mutex); 792 790 INIT_LIST_HEAD(&dev->mode_config.fb_list); 793 791 INIT_LIST_HEAD(&dev->mode_config.fb_kernel_list); 794 792 INIT_LIST_HEAD(&dev->mode_config.crtc_list);
+4
drivers/gpu/drm/drm_drv.c
··· 294 294 */ 295 295 static void drm_cleanup(struct drm_device * dev) 296 296 { 297 + struct drm_map_list *r_list, *list_temp; 297 298 DRM_DEBUG("\n"); 298 299 299 300 if (!dev) { ··· 325 324 326 325 drm_ht_remove(&dev->map_hash); 327 326 drm_ctxbitmap_cleanup(dev); 327 + 328 + list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) 329 + drm_rmmap(dev, r_list->map); 328 330 329 331 if (drm_core_check_feature(dev, DRIVER_MODESET)) 330 332 drm_put_minor(&dev->control);
+1 -1
drivers/gpu/drm/drm_edid.c
··· 660 660 661 661 edid = (struct edid *)drm_ddc_read(adapter); 662 662 if (!edid) { 663 - dev_warn(&connector->dev->pdev->dev, "%s: no EDID data\n", 663 + dev_info(&connector->dev->pdev->dev, "%s: no EDID data\n", 664 664 drm_get_connector_name(connector)); 665 665 return NULL; 666 666 }
+8
drivers/gpu/drm/drm_stub.c
··· 118 118 struct drm_master *master = container_of(kref, struct drm_master, refcount); 119 119 struct drm_magic_entry *pt, *next; 120 120 struct drm_device *dev = master->minor->dev; 121 + struct drm_map_list *r_list, *list_temp; 121 122 122 123 list_del(&master->head); 123 124 124 125 if (dev->driver->master_destroy) 125 126 dev->driver->master_destroy(dev, master); 127 + 128 + list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) { 129 + if (r_list->master == master) { 130 + drm_rmmap_locked(dev, r_list->map); 131 + r_list = NULL; 132 + } 133 + } 126 134 127 135 if (master->unique) { 128 136 drm_free(master->unique, master->unique_size, DRM_MEM_DRIVER);
+4 -3
drivers/gpu/drm/i915/i915_dma.c
··· 944 944 dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) & 945 945 0xff000000; 946 946 947 - DRM_DEBUG("*** fb base 0x%08lx\n", dev->mode_config.fb_base); 948 - 949 - if (IS_MOBILE(dev) || (IS_I9XX(dev) && !IS_I965G(dev) && !IS_G33(dev))) 947 + if (IS_MOBILE(dev) || IS_I9XX(dev)) 950 948 dev_priv->cursor_needs_physical = true; 951 949 else 950 + dev_priv->cursor_needs_physical = false; 951 + 952 + if (IS_I965G(dev) || IS_G33(dev)) 952 953 dev_priv->cursor_needs_physical = false; 953 954 954 955 ret = i915_probe_agp(dev, &agp_size, &prealloc_size);
+1 -1
drivers/gpu/drm/i915/i915_gem.c
··· 3364 3364 { 3365 3365 int i; 3366 3366 3367 - for (i = 0; i < I915_MAX_PHYS_OBJECT; i++) 3367 + for (i = I915_GEM_PHYS_CURSOR_0; i <= I915_MAX_PHYS_OBJECT; i++) 3368 3368 i915_gem_free_phys_object(dev, i); 3369 3369 } 3370 3370
+13
drivers/gpu/drm/i915/intel_lvds.c
··· 340 340 kfree(connector); 341 341 } 342 342 343 + static int intel_lvds_set_property(struct drm_connector *connector, 344 + struct drm_property *property, 345 + uint64_t value) 346 + { 347 + struct drm_device *dev = connector->dev; 348 + 349 + if (property == dev->mode_config.dpms_property && connector->encoder) 350 + intel_lvds_dpms(connector->encoder, (uint32_t)(value & 0xf)); 351 + 352 + return 0; 353 + } 354 + 343 355 static const struct drm_encoder_helper_funcs intel_lvds_helper_funcs = { 344 356 .dpms = intel_lvds_dpms, 345 357 .mode_fixup = intel_lvds_mode_fixup, ··· 371 359 .restore = intel_lvds_restore, 372 360 .detect = intel_lvds_detect, 373 361 .fill_modes = drm_helper_probe_single_connector_modes, 362 + .set_property = intel_lvds_set_property, 374 363 .destroy = intel_lvds_destroy, 375 364 }; 376 365
+2 -1
include/drm/drm_crtc.h
··· 528 528 * 529 529 */ 530 530 struct drm_mode_config { 531 - struct mutex mutex; /* protects configuration and IDR */ 531 + struct mutex mutex; /* protects configuration (mode lists etc.) */ 532 + struct mutex idr_mutex; /* for IDR management */ 532 533 struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ 533 534 /* this is limited to one for now */ 534 535 int num_fb;