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

Commit 86404ab6 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:
  drm/radeon/kms: fix bo's fence association
  drm/radeon/kms: fix indirect buffer management V2
  drm/edid: Fix interlaced detailed timings to be frame size, not field.
  drm/vmwgfx: Use fb handover mechanism instead of stealth mode.
  drm/radeon/kms: use udelay for short delays
  drm/nouveau: Force TV encoder DPMS reinit after resume.
  drm/nouveau: use mutex for vbios lock
parents ab320af2 6b158352
Loading
Loading
Loading
Loading
+45 −2
Original line number Diff line number Diff line
@@ -598,6 +598,50 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
	return mode;
}

/*
 * EDID is delightfully ambiguous about how interlaced modes are to be
 * encoded.  Our internal representation is of frame height, but some
 * HDTV detailed timings are encoded as field height.
 *
 * The format list here is from CEA, in frame size.  Technically we
 * should be checking refresh rate too.  Whatever.
 */
static void
drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
			    struct detailed_pixel_timing *pt)
{
	int i;
	static const struct {
		int w, h;
	} cea_interlaced[] = {
		{ 1920, 1080 },
		{  720,  480 },
		{ 1440,  480 },
		{ 2880,  480 },
		{  720,  576 },
		{ 1440,  576 },
		{ 2880,  576 },
	};
	static const int n_sizes =
		sizeof(cea_interlaced)/sizeof(cea_interlaced[0]);

	if (!(pt->misc & DRM_EDID_PT_INTERLACED))
		return;

	for (i = 0; i < n_sizes; i++) {
		if ((mode->hdisplay == cea_interlaced[i].w) &&
		    (mode->vdisplay == cea_interlaced[i].h / 2)) {
			mode->vdisplay *= 2;
			mode->vsync_start *= 2;
			mode->vsync_end *= 2;
			mode->vtotal *= 2;
			mode->vtotal |= 1;
		}
	}

	mode->flags |= DRM_MODE_FLAG_INTERLACE;
}

/**
 * drm_mode_detailed - create a new mode from an EDID detailed timing section
 * @dev: DRM device (needed to create new mode)
@@ -680,8 +724,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,

	drm_mode_set_name(mode);

	if (pt->misc & DRM_EDID_PT_INTERLACED)
		mode->flags |= DRM_MODE_FLAG_INTERLACE;
	drm_mode_do_interlace_quirk(mode, pt);

	if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) {
		pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE;
+3 −4
Original line number Diff line number Diff line
@@ -5861,13 +5861,12 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table,
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nvbios *bios = &dev_priv->VBIOS;
	struct init_exec iexec = { true, false };
	unsigned long flags;

	spin_lock_irqsave(&bios->lock, flags);
	mutex_lock(&bios->lock);
	bios->display.output = dcbent;
	parse_init_table(bios, table, &iexec);
	bios->display.output = NULL;
	spin_unlock_irqrestore(&bios->lock, flags);
	mutex_unlock(&bios->lock);
}

static bool NVInitVBIOS(struct drm_device *dev)
@@ -5876,7 +5875,7 @@ static bool NVInitVBIOS(struct drm_device *dev)
	struct nvbios *bios = &dev_priv->VBIOS;

	memset(bios, 0, sizeof(struct nvbios));
	spin_lock_init(&bios->lock);
	mutex_init(&bios->lock);
	bios->dev = dev;

	if (!NVShadowVBIOS(dev, bios->data))
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ struct nvbios {
	struct drm_device *dev;
	struct nouveau_bios_info pub;

	spinlock_t lock;
	struct mutex lock;

	uint8_t data[NV_PROM_SIZE];
	unsigned int length;
+2 −0
Original line number Diff line number Diff line
@@ -579,6 +579,8 @@ static void nv17_tv_restore(struct drm_encoder *encoder)
				nouveau_encoder(encoder)->restore.output);

	nv17_tv_state_load(dev, &to_tv_enc(encoder)->saved_state);

	nouveau_encoder(encoder)->last_dpms = NV_DPMS_CLEARED;
}

static int nv17_tv_create_resources(struct drm_encoder *encoder,
+1 −1
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
	uint8_t count = U8((*ptr)++);
	SDEBUG("   count: %d\n", count);
	if (arg == ATOM_UNIT_MICROSEC)
		schedule_timeout_uninterruptible(usecs_to_jiffies(count));
		udelay(count);
	else
		schedule_timeout_uninterruptible(msecs_to_jiffies(count));
}
Loading