rpms/kernel/devel drm-nouveau.patch, 1.23, 1.24 kernel.spec, 1.1420, 1.1421

Ben Skeggs bskeggs at fedoraproject.org
Thu Mar 12 02:11:42 UTC 2009


Author: bskeggs

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27239

Modified Files:
	drm-nouveau.patch kernel.spec 
Log Message:
* Thu Mar 12 2009 Ben Skeggs <bskeggs at redhat.com>
- drm-nouveau.patch: kms display lockup fixes for a heap of chipsets



drm-nouveau.patch:

Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- drm-nouveau.patch	10 Mar 2009 08:15:01 -0000	1.23
+++ drm-nouveau.patch	12 Mar 2009 02:11:40 -0000	1.24
@@ -1840,7 +1840,7 @@
 +#endif /* __NOUVEAU_CONNECTOR_H__ */
 diff --git a/drivers/gpu/drm/nouveau/nouveau_crtc.h b/drivers/gpu/drm/nouveau/nouveau_crtc.h
 new file mode 100644
-index 0000000..c65994f
+index 0000000..53b9584
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_crtc.h
 @@ -0,0 +1,64 @@
@@ -1897,7 +1897,7 @@
 +		int depth;
 +	} lut;
 +
-+	int (*set_dither) (struct nouveau_crtc *crtc);
++	int (*set_dither) (struct nouveau_crtc *crtc, bool update);
 +	int (*set_scale) (struct nouveau_crtc *crtc, int mode, bool update);
 +	int (*set_clock) (struct nouveau_crtc *crtc, struct drm_display_mode *);
 +	int (*set_clock_mode) (struct nouveau_crtc *crtc);
@@ -17091,10 +17091,10 @@
 +}
 diff --git a/drivers/gpu/drm/nouveau/nv50_connector.c b/drivers/gpu/drm/nouveau/nv50_connector.c
 new file mode 100644
-index 0000000..aea44cf
+index 0000000..b7ce637
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv50_connector.c
-@@ -0,0 +1,591 @@
+@@ -0,0 +1,588 @@
 +/*
 + * Copyright (C) 2008 Maarten Maathuis.
 + * All Rights Reserved.
@@ -17459,13 +17459,10 @@
 +
 +		/* update hw state */
 +		crtc->use_dithering = connector->use_dithering;
-+		rval = crtc->set_dither(crtc);
++		rval = crtc->set_dither(crtc, true);
 +		if (rval)
 +			return rval;
 +
-+		/* process command buffer */
-+		OUT_MODE(NV50_UPDATE_DISPLAY, 0);
-+
 +		return 0;
 +	}
 +
@@ -17688,10 +17685,10 @@
 +}
 diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c
 new file mode 100644
-index 0000000..ef888b2
+index 0000000..707461d
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c
-@@ -0,0 +1,768 @@
+@@ -0,0 +1,765 @@
 +/*
 + * Copyright (C) 2008 Maarten Maathuis.
 + * All Rights Reserved.
@@ -17821,11 +17818,10 @@
 +			 NV50_CRTC0_BLANK_CTRL_UNBLANK);
 +	}
 +
-+	OUT_MODE(NV50_UPDATE_DISPLAY, 0);
 +	return 0;
 +}
 +
-+static int nv50_crtc_set_dither(struct nouveau_crtc *crtc)
++static int nv50_crtc_set_dither(struct nouveau_crtc *crtc, bool update)
 +{
 +	struct drm_device *dev = crtc->base.dev;
 +	uint32_t offset = crtc->index * 0x400;
@@ -17835,6 +17831,8 @@
 +	OUT_MODE(NV50_CRTC0_DITHERING_CTRL + offset, crtc->use_dithering ?
 +		 NV50_CRTC0_DITHERING_CTRL_ON : NV50_CRTC0_DITHERING_CTRL_OFF);
 +
++	if (update)
++		OUT_MODE(NV50_UPDATE_DISPLAY, 0);
 +	return 0;
 +}
 +
@@ -18196,18 +18194,6 @@
 +
 +static void nv50_crtc_dpms(struct drm_crtc *drm_crtc, int mode)
 +{
-+	struct nouveau_crtc *crtc = to_nouveau_crtc(drm_crtc);
-+
-+	switch (mode) {
-+	case DRM_MODE_DPMS_ON:
-+	case DRM_MODE_DPMS_STANDBY:
-+	case DRM_MODE_DPMS_SUSPEND:
-+		nv50_crtc_blank(crtc, false);
-+		break;
-+	case DRM_MODE_DPMS_OFF:
-+		nv50_crtc_blank(crtc, true);
-+		break;
-+	}
 +}
 +
 +static void nv50_crtc_prepare(struct drm_crtc *drm_crtc)
@@ -18219,9 +18205,12 @@
 +
 +static void nv50_crtc_commit(struct drm_crtc *drm_crtc)
 +{
++	struct drm_device *dev = drm_crtc->dev;
 +	struct nouveau_crtc *crtc = to_nouveau_crtc(drm_crtc);
 +
 +	nv50_crtc_blank(crtc, false);
++
++	OUT_MODE(NV50_UPDATE_DISPLAY, 0);
 +}
 +
 +static bool nv50_crtc_mode_fixup(struct drm_crtc *drm_crtc,
@@ -18232,6 +18221,59 @@
 +}
 +
 +static int
++nv50_crtc_do_mode_set_base(struct drm_crtc *drm_crtc, int x, int y,
++			   struct drm_framebuffer *old_fb, bool update)
++{
++	struct nouveau_crtc *crtc = to_nouveau_crtc(drm_crtc);
++	struct drm_device *dev = crtc->base.dev;
++	struct drm_nouveau_private *dev_priv = dev->dev_private;
++	struct drm_framebuffer *drm_fb = crtc->base.fb;
++	struct nouveau_framebuffer *fb = to_nouveau_framebuffer(drm_fb);
++	struct nouveau_gem_object *ngem = nouveau_gem_object(fb->gem);
++	uint32_t offset = crtc->index * 0x400;
++
++	crtc->fb.offset = ngem->bo->offset - dev_priv->vm_vram_base;
++
++	OUT_MODE(NV50_CRTC0_FB_OFFSET + offset, crtc->fb.offset >> 8);
++	OUT_MODE(0x864 + offset, 0);
++
++	OUT_MODE(NV50_CRTC0_FB_SIZE + offset,
++		 drm_fb->height << 16 | drm_fb->width);
++
++	/* I suspect this flag indicates a linear fb. */
++	OUT_MODE(NV50_CRTC0_FB_PITCH + offset, drm_fb->pitch | 0x100000);
++
++	switch (drm_fb->depth) {
++	case 8:
++		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_8BPP); 
++		break;
++	case 15:
++		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_15BPP);
++		break;
++	case 16:
++		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_16BPP);
++		break;
++	case 24:
++		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_24BPP); 
++		break;
++	}
++
++	OUT_MODE(NV50_CRTC0_COLOR_CTRL + offset,
++		 NV50_CRTC_COLOR_CTRL_MODE_COLOR);
++	OUT_MODE(NV50_CRTC0_FB_POS + offset, (y << 16) | x);
++
++	if (crtc->lut.depth != fb->base.depth) {
++		crtc->lut.depth = fb->base.depth;
++		nv50_crtc_lut_load(crtc);
++	}
++
++	if (update)
++		OUT_MODE(NV50_UPDATE_DISPLAY, 0);
++
++	return 0;
++}
++
++static int
 +nv50_crtc_mode_set(struct drm_crtc *drm_crtc, struct drm_display_mode *mode,
 +		   struct drm_display_mode *adjusted_mode, int x, int y,
 +		   struct drm_framebuffer *old_fb)
@@ -18240,7 +18282,6 @@
 +	struct nouveau_crtc *crtc = to_nouveau_crtc(drm_crtc);
 +	struct drm_encoder *drm_encoder;
 +	struct nouveau_encoder *encoder;
-+	struct drm_crtc_helper_funcs *crtc_helper = drm_crtc->helper_private;
 +	struct nouveau_connector *connector = NULL;
 +	uint32_t hsync_dur,  vsync_dur, hsync_start_to_end, vsync_start_to_end;
 +	uint32_t hunk1, vunk1, vunk2a, vunk2b;
@@ -18318,7 +18359,7 @@
 +			 (vunk2b - 1) << 16 | (vunk2a - 1));
 +	}
 +
-+	crtc->set_dither(crtc);
++	crtc->set_dither(crtc, false);
 +
 +	/* This is the actual resolution of the mode. */
 +	OUT_MODE(NV50_CRTC0_REAL_RES + offset,
@@ -18327,63 +18368,16 @@
 +		 NV50_CRTC_SCALE_CENTER_OFFSET_VAL(0,0));
 +
 +	crtc->set_scale(crtc, connector->scaling_mode, false);
-+	crtc_helper->mode_set_base(drm_crtc, x, y, old_fb);
-+
-+	return 0;
++	return nv50_crtc_do_mode_set_base(drm_crtc, x, y, old_fb, false);
 +}
 +
 +static int
 +nv50_crtc_mode_set_base(struct drm_crtc *drm_crtc, int x, int y,
 +			struct drm_framebuffer *old_fb)
 +{
-+	struct nouveau_crtc *crtc = to_nouveau_crtc(drm_crtc);
-+	struct drm_device *dev = crtc->base.dev;
-+	struct drm_nouveau_private *dev_priv = dev->dev_private;
-+	struct drm_framebuffer *drm_fb = crtc->base.fb;
-+	struct nouveau_framebuffer *fb = to_nouveau_framebuffer(drm_fb);
-+	struct nouveau_gem_object *ngem = nouveau_gem_object(fb->gem);
-+	uint32_t offset = crtc->index * 0x400;
-+
-+	crtc->fb.offset = ngem->bo->offset - dev_priv->vm_vram_base;
-+
-+	OUT_MODE(NV50_CRTC0_FB_OFFSET + offset, crtc->fb.offset >> 8);
-+	OUT_MODE(0x864 + offset, 0);
-+
-+	OUT_MODE(NV50_CRTC0_FB_SIZE + offset,
-+		 drm_fb->height << 16 | drm_fb->width);
-+
-+	/* I suspect this flag indicates a linear fb. */
-+	OUT_MODE(NV50_CRTC0_FB_PITCH + offset, drm_fb->pitch | 0x100000);
-+
-+	switch (drm_fb->depth) {
-+	case 8:
-+		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_8BPP); 
-+		break;
-+	case 15:
-+		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_15BPP);
-+		break;
-+	case 16:
-+		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_16BPP);
-+		break;
-+	case 24:
-+		OUT_MODE(NV50_CRTC0_DEPTH + offset, NV50_CRTC0_DEPTH_24BPP); 
-+		break;
-+	}
-+
-+	OUT_MODE(NV50_CRTC0_COLOR_CTRL + offset,
-+		 NV50_CRTC_COLOR_CTRL_MODE_COLOR);
-+	OUT_MODE(NV50_CRTC0_FB_POS + offset, (y << 16) | x);
-+
-+	if (crtc->lut.depth != fb->base.depth) {
-+		crtc->lut.depth = fb->base.depth;
-+		nv50_crtc_lut_load(crtc);
-+	}
-+
-+	OUT_MODE(NV50_UPDATE_DISPLAY, 0);
-+	return 0;
++	return nv50_crtc_do_mode_set_base(drm_crtc, x, y, old_fb, true);
 +}
 +
-+
 +static const struct drm_crtc_helper_funcs nv50_crtc_helper_funcs = {
 +	.dpms = nv50_crtc_dpms,
 +	.prepare = nv50_crtc_prepare,
@@ -19022,10 +19016,10 @@
 +
 diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
 new file mode 100644
-index 0000000..0e9fd37
+index 0000000..ac69865
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nv50_display.c
-@@ -0,0 +1,442 @@
+@@ -0,0 +1,441 @@
 +/*
 + * Copyright (C) 2008 Maarten Maathuis.
 + * All Rights Reserved.
@@ -19094,7 +19088,8 @@
 +	nv_wr32(0x006101f0 + 2 * 0x4, nv_rd32(0x0061e000 + 2 * 0x800));
 +
 +	for (i = 0; i < 3; i++) {
-+		nv_wr32(NV50_PDISPLAY_DAC_REGS_DPMS_CTRL(i), 0x00550000 | NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_PENDING);
++		nv_wr32(NV50_PDISPLAY_DAC_REGS_DPMS_CTRL(i), 0x00550000 |
++			NV50_PDISPLAY_DAC_REGS_DPMS_CTRL_PENDING);
 +		nv_wr32(NV50_PDISPLAY_DAC_REGS_CLK_CTRL1(i), 0x00000001);
 +	}
 +
@@ -19171,8 +19166,6 @@
 +	OUT_MODE(NV50_CRTC0_DISPLAY_START, 0);
 +	OUT_MODE(NV50_CRTC0_UNK82C, 0);
 +
-+	OUT_MODE(NV50_UPDATE_DISPLAY, 0);
-+
 +	/* enable clock change interrupts. */
 +//	nv_wr32(NV50_PDISPLAY_SUPERVISOR_INTR, nv_rd32(NV50_PDISPLAY_SUPERVISOR_INTR) | 0x70);
 +
@@ -19277,6 +19270,10 @@
 +
 +	dev->mode_config.fb_base = dev_priv->fb_phys;
 +
++	ret = nv50_display_pre_init(dev);
++	if (ret)
++		return ret;
++
 +	/* Create CRTC objects */
 +	for (i = 0; i < 2; i++) {
 +		nv50_crtc_create(dev, i);
@@ -19345,10 +19342,6 @@
 +		bus_mask |= (1 << entry->bus);
 +	}
 +
-+	ret = nv50_display_pre_init(dev);
-+	if (ret)
-+		return ret;
-+
 +	ret = nv50_display_init(dev);
 +	if (ret)
 +		return ret;


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1420
retrieving revision 1.1421
diff -u -r1.1420 -r1.1421
--- kernel.spec	12 Mar 2009 01:45:20 -0000	1.1420
+++ kernel.spec	12 Mar 2009 02:11:41 -0000	1.1421
@@ -1822,6 +1822,9 @@
 # and build.
 
 %changelog
+* Thu Mar 12 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: kms display lockup fixes for a heap of chipsets
+
 * Thu Mar 12 2009 Dave Airlie <airlied at redhat.com>
 - radeon kms - bug fix irq and ib handling on r300 + suspend test hook
 - fix sparc build with kms from spot




More information about the fedora-extras-commits mailing list