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

Commit 06f01e73 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  vgaarb: Wrap vga_(get|put) in CONFIG_VGA_ARB
  drm/radeon/kms: add missing scratch update in dp_detect
  drm/modes: Fix CVT-R modeline generation
  drm: fix regression in drm locking since BKL removal.
  drm/radeon/kms: remove stray radeon_i2c_destroy
  drm: mm: fix range restricted allocations
  drm/nouveau: drop drm_global_mutex before sleeping in submission path
  drm: export drm_global_mutex for drivers to use
  drm/nv20: Don't use pushbuf calls on the original nv20.
  drm/nouveau: Fix TMDS on some DCB1.5 boards.
  drm/nouveau: Fix backlight control on PPC machines with an internal TMDS panel.
  drm/nv30: Apply modesetting to the correct slave encoder
  drm/nouveau: Use a helper function to match PCI device/subsystem IDs.
  drm/nv50: add dcb type 14 to enum to prevent compiler complaint
parents 51bbd47d 04cbe1de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@

/* from BKL pushdown: note that nothing else serializes idr_find() */
DEFINE_MUTEX(drm_global_mutex);
EXPORT_SYMBOL(drm_global_mutex);

static int drm_open_helper(struct inode *inode, struct file *filp,
			   struct drm_device * dev);
+2 −0
Original line number Diff line number Diff line
@@ -92,7 +92,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
		}

		/* Contention */
		mutex_unlock(&drm_global_mutex);
		schedule();
		mutex_lock(&drm_global_mutex);
		if (signal_pending(current)) {
			ret = -EINTR;
			break;
+14 −10
Original line number Diff line number Diff line
@@ -285,21 +285,21 @@ void drm_mm_put_block(struct drm_mm_node *cur)

EXPORT_SYMBOL(drm_mm_put_block);

static int check_free_mm_node(struct drm_mm_node *entry, unsigned long size,
			      unsigned alignment)
static int check_free_hole(unsigned long start, unsigned long end,
			   unsigned long size, unsigned alignment)
{
	unsigned wasted = 0;

	if (entry->size < size)
	if (end - start < size)
		return 0;

	if (alignment) {
		register unsigned tmp = entry->start % alignment;
		unsigned tmp = start % alignment;
		if (tmp)
			wasted = alignment - tmp;
	}

	if (entry->size >= size + wasted) {
	if (end >= start + size + wasted) {
		return 1;
	}

@@ -320,7 +320,8 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
	best_size = ~0UL;

	list_for_each_entry(entry, &mm->free_stack, free_stack) {
		if (!check_free_mm_node(entry, size, alignment))
		if (!check_free_hole(entry->start, entry->start + entry->size,
				     size, alignment))
			continue;

		if (!best_match)
@@ -353,10 +354,12 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm,
	best_size = ~0UL;

	list_for_each_entry(entry, &mm->free_stack, free_stack) {
		if (entry->start > end || (entry->start+entry->size) < start)
			continue;
		unsigned long adj_start = entry->start < start ?
			start : entry->start;
		unsigned long adj_end = entry->start + entry->size > end ?
			end : entry->start + entry->size;

		if (!check_free_mm_node(entry, size, alignment))
		if (!check_free_hole(adj_start, adj_end, size, alignment))
			continue;

		if (!best_match)
@@ -449,7 +452,8 @@ int drm_mm_scan_add_block(struct drm_mm_node *node)
	node->free_stack.prev = prev_free;
	node->free_stack.next = next_free;

	if (check_free_mm_node(node, mm->scan_size, mm->scan_alignment)) {
	if (check_free_hole(node->start, node->start + node->size,
			    mm->scan_size, mm->scan_alignment)) {
		mm->scan_hit_start = node->start;
		mm->scan_hit_size = node->size;

+4 −1
Original line number Diff line number Diff line
@@ -251,7 +251,10 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
		drm_mode->htotal = drm_mode->hdisplay + CVT_RB_H_BLANK;
		/* Fill in HSync values */
		drm_mode->hsync_end = drm_mode->hdisplay + CVT_RB_H_BLANK / 2;
		drm_mode->hsync_start = drm_mode->hsync_end = CVT_RB_H_SYNC;
		drm_mode->hsync_start = drm_mode->hsync_end - CVT_RB_H_SYNC;
		/* Fill in VSync values */
		drm_mode->vsync_start = drm_mode->vdisplay + CVT_RB_VFPORCH;
		drm_mode->vsync_end = drm_mode->vsync_start + vsync;
	}
	/* 15/13. Find pixel clock frequency (kHz for xf86) */
	drm_mode->clock = drm_mode->htotal * HV_FACTOR * 1000 / hperiod;
+15 −49
Original line number Diff line number Diff line
@@ -3869,27 +3869,10 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_entr
	}
#ifdef __powerpc__
	/* Powerbook specific quirks */
	if ((dev->pci_device & 0xffff) == 0x0179 ||
	    (dev->pci_device & 0xffff) == 0x0189 ||
	    (dev->pci_device & 0xffff) == 0x0329) {
		if (script == LVDS_RESET) {
	if (script == LVDS_RESET &&
	    (dev->pci_device == 0x0179 || dev->pci_device == 0x0189 ||
	     dev->pci_device == 0x0329))
		nv_write_tmds(dev, dcbent->or, 0, 0x02, 0x72);

		} else if (script == LVDS_PANEL_ON) {
			bios_wr32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL,
				  bios_rd32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL)
				  | (1 << 31));
			bios_wr32(bios, NV_PCRTC_GPIO_EXT,
				  bios_rd32(bios, NV_PCRTC_GPIO_EXT) | 1);

		} else if (script == LVDS_PANEL_OFF) {
			bios_wr32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL,
				  bios_rd32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL)
				  & ~(1 << 31));
			bios_wr32(bios, NV_PCRTC_GPIO_EXT,
				  bios_rd32(bios, NV_PCRTC_GPIO_EXT) & ~3);
		}
	}
#endif

	return 0;
@@ -4381,11 +4364,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
	 *
	 * For the moment, a quirk will do :)
	 */
	if ((dev->pdev->device == 0x01d7) &&
	    (dev->pdev->subsystem_vendor == 0x1028) &&
	    (dev->pdev->subsystem_device == 0x01c2)) {
	if (nv_match_device(dev, 0x01d7, 0x1028, 0x01c2))
		bios->fp.duallink_transition_clk = 80000;
	}

	/* set dual_link flag for EDID case */
	if (pxclk && (chip_version < 0x25 || chip_version > 0x28))
@@ -5814,9 +5794,7 @@ parse_dcb_gpio_table(struct nvbios *bios)
		 */

		/* Apple iMac G4 NV18 */
		if (dev->pdev->device == 0x0189 &&
		    dev->pdev->subsystem_vendor == 0x10de &&
		    dev->pdev->subsystem_device == 0x0010) {
		if (nv_match_device(dev, 0x0189, 0x10de, 0x0010)) {
			struct dcb_gpio_entry *gpio = new_gpio_entry(bios);

			gpio->tag = DCB_GPIO_TVDAC0;
@@ -5898,9 +5876,7 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx)
	struct drm_device *dev = bios->dev;

	/* Gigabyte NX85T */
	if ((dev->pdev->device == 0x0421) &&
	    (dev->pdev->subsystem_vendor == 0x1458) &&
	    (dev->pdev->subsystem_device == 0x344c)) {
	if (nv_match_device(dev, 0x0421, 0x1458, 0x344c)) {
		if (cte->type == DCB_CONNECTOR_HDMI_1)
			cte->type = DCB_CONNECTOR_DVI_I;
	}
@@ -6153,7 +6129,7 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb,
			entry->tmdsconf.slave_addr = (conf & 0x00000070) >> 4;

		break;
	case 0xe:
	case OUTPUT_EOL:
		/* weird g80 mobile type that "nv" treats as a terminator */
		dcb->entries--;
		return false;
@@ -6190,23 +6166,15 @@ parse_dcb15_entry(struct drm_device *dev, struct dcb_table *dcb,
		entry->type = OUTPUT_TV;
		break;
	case 2:
	case 3:
		entry->type = OUTPUT_LVDS;
		break;
	case 4:
		switch ((conn & 0x000000f0) >> 4) {
		case 0:
		if (conn & 0x10)
			entry->type = OUTPUT_LVDS;
		else
			entry->type = OUTPUT_TMDS;
		break;
		case 1:
	case 3:
		entry->type = OUTPUT_LVDS;
		break;
		default:
			NV_ERROR(dev, "Unknown DCB subtype 4/%d\n",
				 (conn & 0x000000f0) >> 4);
			return false;
		}
		break;
	default:
		NV_ERROR(dev, "Unknown DCB type %d\n", conn & 0x0000000f);
		return false;
@@ -6321,9 +6289,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf)
	 * nasty problems until this is sorted (assuming it's not a
	 * VBIOS bug).
	 */
	if ((dev->pdev->device == 0x040d) &&
	    (dev->pdev->subsystem_vendor == 0x1028) &&
	    (dev->pdev->subsystem_device == 0x019b)) {
	if (nv_match_device(dev, 0x040d, 0x1028, 0x019b)) {
		if (*conn == 0x02026312 && *conf == 0x00000020)
			return false;
	}
Loading