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

Commit 40c7f211 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (177 commits)
  drm/radeon: fixup refcounts in radeon dumb create ioctl.
  drm: radeon: *_cs_packet_parse_vline() cleanup
  radeon: merge list_del()/list_add_tail() to list_move_tail()
  drm: Retry i2c transfer of EDID block after failure
  drm/radeon/kms: fix typo in atom overscan setup
  drm: Hold the mode mutex whilst probing for sysfs status
  drm/nouveau: fix __nouveau_fence_wait performance
  drm/nv40: attempt to reserve just enough vram for all 32 channels
  drm/nv50: check for vm traps on every gr irq
  drm/nv50: decode vm faults some more
  drm/nouveau: add nouveau_enum_find() util function
  drm/nouveau: properly handle pushbuffer check failures
  drm/nvc0: remove vm hack forcing large/small pages to not share a PDE
  drm/i915: disable opregion lid detection for now.
  drm/i915: Only wait on a pending flip if we intend to write to the buffer
  drm/i915/dp: Sanity check eDP existence
  drm: add cap bit to denote if dumb ioctl is available or not.
  drm/core: add ioctl to query device/driver capabilities
  drm/radeon/kms: allow max clock of 340 Mhz on hdmi 1.3+
  drm/radeon/kms: add cayman pci ids
  ...
parents b04d0a90 c87a8d8d
Loading
Loading
Loading
Loading
+19 −28
Original line number Diff line number Diff line
@@ -73,32 +73,17 @@ source "drivers/gpu/drm/radeon/Kconfig"

config DRM_I810
	tristate "Intel I810"
	# BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
	depends on DRM && AGP && AGP_INTEL && BKL
	# !PREEMPT because of missing ioctl locking
	depends on DRM && AGP && AGP_INTEL && (!PREEMPT || BROKEN)
	help
	  Choose this option if you have an Intel I810 graphics card.  If M is
	  selected, the module will be called i810.  AGP support is required
	  for this driver to work.

choice
	prompt "Intel 830M, 845G, 852GM, 855GM, 865G"
	depends on DRM && AGP && AGP_INTEL
	optional

config DRM_I830
	tristate "i830 driver"
	# BKL usage in order to avoid AB-BA deadlocks, i830 may get removed
	depends on BKL
	help
	  Choose this option if you have a system that has Intel 830M, 845G,
	  852GM, 855GM or 865G integrated graphics.  If M is selected, the
	  module will be called i830.  AGP support is required for this driver
	  to work. This driver is used by the older X releases X.org 6.7 and
	  XFree86 4.3. If unsure, build this and i915 as modules and the X server
	  will load the correct one.

config DRM_I915
	tristate "i915 driver"
	tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
	depends on DRM
	depends on AGP
	depends on AGP_INTEL
	# we need shmfs for the swappable backing store, and in particular
	# the shmem_readpage() which depends upon tmpfs
@@ -115,12 +100,20 @@ config DRM_I915
	select ACPI_VIDEO if ACPI
	select ACPI_BUTTON if ACPI
	help
	  Choose this option if you have a system that has Intel 830M, 845G,
	  852GM, 855GM 865G or 915G integrated graphics.  If M is selected, the
	  module will be called i915.  AGP support is required for this driver
	  to work. This driver is used by the Intel driver in X.org 6.8 and
	  XFree86 4.4 and above. If unsure, build this and i830 as modules and
	  the X server will load the correct one.
	  Choose this option if you have a system that has "Intel Graphics
	  Media Accelerator" or "HD Graphics" integrated graphics,
	  including 830M, 845G, 852GM, 855GM, 865G, 915G, 945G, 965G,
	  G35, G41, G43, G45 chipsets and Celeron, Pentium, Core i3,
	  Core i5, Core i7 as well as Atom CPUs with integrated graphics.
	  If M is selected, the module will be called i915.  AGP support
	  is required for this driver to work. This driver is used by
	  the Intel driver in X.org 6.8 and XFree86 4.4 and above. It
	  replaces the older i830 module that supported a subset of the
	  hardware in older X.org releases.

	  Note that the older i810/i815 chipsets require the use of the
	  i810 driver instead, and the Atom z5xx series has an entirely
	  different implementation.

config DRM_I915_KMS
	bool "Enable modesetting on intel by default"
@@ -132,8 +125,6 @@ config DRM_I915_KMS
	  the driver to bind to PCI devices, which precludes loading things
	  like intelfb.

endchoice

config DRM_MGA
	tristate "Matrox g200/g400"
	depends on DRM && PCI
+1 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
		drm_platform.o drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o \
		drm_crtc.o drm_modes.o drm_edid.o \
		drm_info.o drm_debugfs.o drm_encoder_slave.o \
		drm_trace_points.o drm_global.o
		drm_trace_points.o drm_global.o drm_usb.o

drm-$(CONFIG_COMPAT) += drm_ioc32.o

@@ -29,7 +29,6 @@ obj-$(CONFIG_DRM_R128) += r128/
obj-$(CONFIG_DRM_RADEON)+= radeon/
obj-$(CONFIG_DRM_MGA)	+= mga/
obj-$(CONFIG_DRM_I810)	+= i810/
obj-$(CONFIG_DRM_I830)	+= i830/
obj-$(CONFIG_DRM_I915)  += i915/
obj-$(CONFIG_DRM_SIS)   += sis/
obj-$(CONFIG_DRM_SAVAGE)+= savage/
+33 −0
Original line number Diff line number Diff line
@@ -2694,3 +2694,36 @@ void drm_mode_config_reset(struct drm_device *dev)
			connector->funcs->reset(connector);
}
EXPORT_SYMBOL(drm_mode_config_reset);

int drm_mode_create_dumb_ioctl(struct drm_device *dev,
			       void *data, struct drm_file *file_priv)
{
	struct drm_mode_create_dumb *args = data;

	if (!dev->driver->dumb_create)
		return -ENOSYS;
	return dev->driver->dumb_create(file_priv, dev, args);
}

int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
			     void *data, struct drm_file *file_priv)
{
	struct drm_mode_map_dumb *args = data;

	/* call driver ioctl to get mmap offset */
	if (!dev->driver->dumb_map_offset)
		return -ENOSYS;

	return dev->driver->dumb_map_offset(file_priv, dev, args->handle, &args->offset);
}

int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
				void *data, struct drm_file *file_priv)
{
	struct drm_mode_destroy_dumb *args = data;

	if (!dev->driver->dumb_destroy)
		return -ENOSYS;

	return dev->driver->dumb_destroy(file_priv, dev, args->handle);
}
+5 −44
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ static struct drm_ioctl_desc drm_ioctls[] = {
	DRM_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_getmap, 0),
	DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, 0),
	DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, 0),
	DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, 0),
	DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER),

	DRM_IOCTL_DEF(DRM_IOCTL_SET_UNIQUE, drm_setunique, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
@@ -150,7 +151,10 @@ static struct drm_ioctl_desc drm_ioctls[] = {
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED)
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED),
	DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED)
};

#define DRM_CORE_IOCTL_COUNT	ARRAY_SIZE( drm_ioctls )
@@ -234,49 +238,6 @@ int drm_lastclose(struct drm_device * dev)
	return 0;
}

/**
 * Module initialization. Called via init_module at module load time, or via
 * linux/init/main.c (this is not currently supported).
 *
 * \return zero on success or a negative number on failure.
 *
 * Initializes an array of drm_device structures, and attempts to
 * initialize all available devices, using consecutive minors, registering the
 * stubs and initializing the device.
 *
 * Expands the \c DRIVER_PREINIT and \c DRIVER_POST_INIT macros before and
 * after the initialization for driver customization.
 */
int drm_init(struct drm_driver *driver)
{
	DRM_DEBUG("\n");
	INIT_LIST_HEAD(&driver->device_list);

	if (driver->driver_features & DRIVER_USE_PLATFORM_DEVICE)
		return drm_platform_init(driver);
	else
		return drm_pci_init(driver);
}

EXPORT_SYMBOL(drm_init);

void drm_exit(struct drm_driver *driver)
{
	struct drm_device *dev, *tmp;
	DRM_DEBUG("\n");

	if (driver->driver_features & DRIVER_MODESET) {
		pci_unregister_driver(&driver->pci_driver);
	} else {
		list_for_each_entry_safe(dev, tmp, &driver->device_list, driver_item)
			drm_put_dev(dev);
	}

	DRM_INFO("Module unloaded\n");
}

EXPORT_SYMBOL(drm_exit);

/** File operations structure */
static const struct file_operations drm_stub_fops = {
	.owner = THIS_MODULE,
+34 −25
Original line number Diff line number Diff line
@@ -230,6 +230,15 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
		      int block, int len)
{
	unsigned char start = block * EDID_LENGTH;
	int ret, retries = 5;

	/* The core i2c driver will automatically retry the transfer if the
	 * adapter reports EAGAIN. However, we find that bit-banging transfers
	 * are susceptible to errors under a heavily loaded machine and
	 * generate spurious NAKs and timeouts. Retrying the transfer
	 * of the individual block a few times seems to overcome this.
	 */
	do {
		struct i2c_msg msgs[] = {
			{
				.addr	= DDC_ADDR,
@@ -243,11 +252,10 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
				.buf	= buf,
			}
		};
		ret = i2c_transfer(adapter, msgs, 2);
	} while (ret != 2 && --retries);

	if (i2c_transfer(adapter, msgs, 2) == 2)
		return 0;

	return -1;
	return ret == 2 ? 0 : -1;
}

static u8 *
@@ -449,12 +457,11 @@ static void edid_fixup_preferred(struct drm_connector *connector,
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
					   int hsize, int vsize, int fresh)
{
	struct drm_display_mode *mode = NULL;
	int i;
	struct drm_display_mode *ptr, *mode;

	mode = NULL;
	for (i = 0; i < drm_num_dmt_modes; i++) {
		ptr = &drm_dmt_modes[i];
		const struct drm_display_mode *ptr = &drm_dmt_modes[i];
		if (hsize == ptr->hdisplay &&
			vsize == ptr->vdisplay &&
			fresh == drm_mode_vrefresh(ptr)) {
@@ -885,7 +892,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
}

static bool
mode_is_rb(struct drm_display_mode *mode)
mode_is_rb(const struct drm_display_mode *mode)
{
	return (mode->htotal - mode->hdisplay == 160) &&
	       (mode->hsync_end - mode->hdisplay == 80) &&
@@ -894,7 +901,8 @@ mode_is_rb(struct drm_display_mode *mode)
}

static bool
mode_in_hsync_range(struct drm_display_mode *mode, struct edid *edid, u8 *t)
mode_in_hsync_range(const struct drm_display_mode *mode,
		    struct edid *edid, u8 *t)
{
	int hsync, hmin, hmax;

@@ -910,7 +918,8 @@ mode_in_hsync_range(struct drm_display_mode *mode, struct edid *edid, u8 *t)
}

static bool
mode_in_vsync_range(struct drm_display_mode *mode, struct edid *edid, u8 *t)
mode_in_vsync_range(const struct drm_display_mode *mode,
		    struct edid *edid, u8 *t)
{
	int vsync, vmin, vmax;

@@ -941,7 +950,7 @@ range_pixel_clock(struct edid *edid, u8 *t)
}

static bool
mode_in_range(struct drm_display_mode *mode, struct edid *edid,
mode_in_range(const struct drm_display_mode *mode, struct edid *edid,
	      struct detailed_timing *timing)
{
	u32 max_clock;
@@ -1472,7 +1481,7 @@ int drm_add_modes_noedid(struct drm_connector *connector,
			int hdisplay, int vdisplay)
{
	int i, count, num_modes = 0;
	struct drm_display_mode *mode, *ptr;
	struct drm_display_mode *mode;
	struct drm_device *dev = connector->dev;

	count = sizeof(drm_dmt_modes) / sizeof(struct drm_display_mode);
@@ -1482,7 +1491,7 @@ int drm_add_modes_noedid(struct drm_connector *connector,
		vdisplay = 0;

	for (i = 0; i < count; i++) {
		ptr = &drm_dmt_modes[i];
		const struct drm_display_mode *ptr = &drm_dmt_modes[i];
		if (hdisplay && vdisplay) {
			/*
			 * Only when two are valid, they will be used to check
Loading