Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2eb2fa6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (21 commits)
  drm/radeon: load the right microcode on rs780
  drm: remove unused "can_grow" parameter from drm_crtc_helper_initial_config
  drm: fix EDID backward compat check
  drm: sync the mode validation for INTERLACE/DBLSCAN
  drm: fix typo in edid vendor parsing.
  DRM: drm_crtc_helper.h doesn't actually need i2c.h
  drm: fix missing inline function on 32-bit powerpc.
  drm: Use pgprot_writecombine in GEM GTT mapping to get the right bits for !PAT.
  drm/i915: Add a spinlock to protect the active_list
  drm/i915: Fix SDVO TV support
  drm/i915: Fix SDVO CREATE_PREFERRED_INPUT_TIMING command
  drm/i915: Fix error in SDVO DTD and modeline convert
  drm/i915: Fix SDVO command debug function
  drm/i915: fix TV mode setting in property change
  drm/i915: only set TV mode when any property changed
  drm/i915: clean up udelay usage
  drm/i915: add VGA hotplug support for 945+
  drm/i915: correctly set IGD device's gtt size for KMS.
  drm/i915: avoid hanging on to a stale pointer to raw_edid.
  drm/i915: check for -EINVAL from vm_insert_pfn
  ...
parents ef8a97bb 029a2edb
Loading
Loading
Loading
Loading
+29 −2
Original line number Original line Diff line number Diff line
@@ -42,6 +42,26 @@ static struct drm_display_mode std_modes[] = {
		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
};
};


static void drm_mode_validate_flag(struct drm_connector *connector,
				   int flags)
{
	struct drm_display_mode *mode, *t;

	if (flags == (DRM_MODE_FLAG_DBLSCAN | DRM_MODE_FLAG_INTERLACE))
		return;

	list_for_each_entry_safe(mode, t, &connector->modes, head) {
		if ((mode->flags & DRM_MODE_FLAG_INTERLACE) &&
				!(flags & DRM_MODE_FLAG_INTERLACE))
			mode->status = MODE_NO_INTERLACE;
		if ((mode->flags & DRM_MODE_FLAG_DBLSCAN) &&
				!(flags & DRM_MODE_FLAG_DBLSCAN))
			mode->status = MODE_NO_DBLESCAN;
	}

	return;
}

/**
/**
 * drm_helper_probe_connector_modes - get complete set of display modes
 * drm_helper_probe_connector_modes - get complete set of display modes
 * @dev: DRM device
 * @dev: DRM device
@@ -72,6 +92,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
	struct drm_connector_helper_funcs *connector_funcs =
	struct drm_connector_helper_funcs *connector_funcs =
		connector->helper_private;
		connector->helper_private;
	int count = 0;
	int count = 0;
	int mode_flags = 0;


	DRM_DEBUG("%s\n", drm_get_connector_name(connector));
	DRM_DEBUG("%s\n", drm_get_connector_name(connector));
	/* set all modes to the unverified state */
	/* set all modes to the unverified state */
@@ -96,6 +117,13 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
	if (maxX && maxY)
	if (maxX && maxY)
		drm_mode_validate_size(dev, &connector->modes, maxX,
		drm_mode_validate_size(dev, &connector->modes, maxX,
				       maxY, 0);
				       maxY, 0);

	if (connector->interlace_allowed)
		mode_flags |= DRM_MODE_FLAG_INTERLACE;
	if (connector->doublescan_allowed)
		mode_flags |= DRM_MODE_FLAG_DBLSCAN;
	drm_mode_validate_flag(connector, mode_flags);

	list_for_each_entry_safe(mode, t, &connector->modes, head) {
	list_for_each_entry_safe(mode, t, &connector->modes, head) {
		if (mode->status == MODE_OK)
		if (mode->status == MODE_OK)
			mode->status = connector_funcs->mode_valid(connector,
			mode->status = connector_funcs->mode_valid(connector,
@@ -885,7 +913,6 @@ bool drm_helper_plugged_event(struct drm_device *dev)
/**
/**
 * drm_initial_config - setup a sane initial connector configuration
 * drm_initial_config - setup a sane initial connector configuration
 * @dev: DRM device
 * @dev: DRM device
 * @can_grow: this configuration is growable
 *
 *
 * LOCKING:
 * LOCKING:
 * Called at init time, must take mode config lock.
 * Called at init time, must take mode config lock.
@@ -897,7 +924,7 @@ bool drm_helper_plugged_event(struct drm_device *dev)
 * RETURNS:
 * RETURNS:
 * Zero if everything went ok, nonzero otherwise.
 * Zero if everything went ok, nonzero otherwise.
 */
 */
bool drm_helper_initial_config(struct drm_device *dev, bool can_grow)
bool drm_helper_initial_config(struct drm_device *dev)
{
{
	struct drm_connector *connector;
	struct drm_connector *connector;
	int count = 0;
	int count = 0;
+3 −5
Original line number Original line Diff line number Diff line
@@ -125,10 +125,8 @@ static bool edid_is_valid(struct edid *edid)
		DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
		DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
		goto bad;
		goto bad;
	}
	}
	if (edid->revision > 3) {
	if (edid->revision > 4)
		DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision);
		DRM_DEBUG("EDID minor > 4, assuming backward compatibility\n");
		goto bad;
	}


	for (i = 0; i < EDID_LENGTH; i++)
	for (i = 0; i < EDID_LENGTH; i++)
		csum += raw_edid[i];
		csum += raw_edid[i];
@@ -162,7 +160,7 @@ static bool edid_vendor(struct edid *edid, char *vendor)
	edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
	edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
	edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
	edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) |
			  ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
			  ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
	edid_vendor[2] = (edid->mfg_id[2] & 0x1f) + '@';
	edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';


	return !strncmp(edid_vendor, vendor, 3);
	return !strncmp(edid_vendor, vendor, 3);
}
}
+1 −6
Original line number Original line Diff line number Diff line
@@ -505,7 +505,6 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
	struct drm_local_map *map = NULL;
	struct drm_local_map *map = NULL;
	struct drm_gem_object *obj;
	struct drm_gem_object *obj;
	struct drm_hash_item *hash;
	struct drm_hash_item *hash;
	unsigned long prot;
	int ret = 0;
	int ret = 0;


	mutex_lock(&dev->struct_mutex);
	mutex_lock(&dev->struct_mutex);
@@ -538,11 +537,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
	vma->vm_ops = obj->dev->driver->gem_vm_ops;
	vma->vm_ops = obj->dev->driver->gem_vm_ops;
	vma->vm_private_data = map->handle;
	vma->vm_private_data = map->handle;
	/* FIXME: use pgprot_writecombine when available */
	/* FIXME: use pgprot_writecombine when available */
	prot = pgprot_val(vma->vm_page_prot);
	vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
#ifdef CONFIG_X86
	prot |= _PAGE_CACHE_WC;
#endif
	vma->vm_page_prot = __pgprot(prot);


	/* Take a ref for this mapping of the object, so that the fault
	/* Take a ref for this mapping of the object, so that the fault
	 * handler can dereference the mmap offset's pointer to the object.
	 * handler can dereference the mmap offset's pointer to the object.
+1 −0
Original line number Original line Diff line number Diff line
@@ -451,6 +451,7 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)


	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
}
}
EXPORT_SYMBOL(drm_sysfs_hotplug_event);


/**
/**
 * drm_sysfs_device_add - adds a class device to sysfs for a character driver
 * drm_sysfs_device_add - adds a class device to sysfs for a character driver
+2 −9
Original line number Original line Diff line number Diff line
@@ -922,7 +922,7 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size,
	 * Some of the preallocated space is taken by the GTT
	 * Some of the preallocated space is taken by the GTT
	 * and popup.  GTT is 1K per MB of aperture size, and popup is 4K.
	 * and popup.  GTT is 1K per MB of aperture size, and popup is 4K.
	 */
	 */
	if (IS_G4X(dev))
	if (IS_G4X(dev) || IS_IGD(dev))
		overhead = 4096;
		overhead = 4096;
	else
	else
		overhead = (*aperture_size / 1024) + 4096;
		overhead = (*aperture_size / 1024) + 4096;
@@ -1030,13 +1030,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
	if (ret)
	if (ret)
		goto destroy_ringbuffer;
		goto destroy_ringbuffer;


	/* FIXME: re-add hotplug support */
#if 0
	ret = drm_hotplug_init(dev);
	if (ret)
		goto destroy_ringbuffer;
#endif

	/* Always safe in the mode setting case. */
	/* Always safe in the mode setting case. */
	/* FIXME: do pre/post-mode set stuff in core KMS code */
	/* FIXME: do pre/post-mode set stuff in core KMS code */
	dev->vblank_disable_allowed = 1;
	dev->vblank_disable_allowed = 1;
@@ -1049,7 +1042,7 @@ static int i915_load_modeset_init(struct drm_device *dev)


	intel_modeset_init(dev);
	intel_modeset_init(dev);


	drm_helper_initial_config(dev, false);
	drm_helper_initial_config(dev);


	return 0;
	return 0;


Loading