rpms/kernel/devel drm-intel-next.patch, 1.9, 1.10 kernel.spec, 1.1739, 1.1740

Adam Jackson ajax at fedoraproject.org
Wed Aug 26 13:58:24 UTC 2009


Author: ajax

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

Modified Files:
	drm-intel-next.patch kernel.spec 
Log Message:
* Wed Aug 26 2009 Adam Jackson <ajax at redhat.com>
- drm-intel-next.patch: Update, various output setup fixes.


drm-intel-next.patch:
 intel_crt.c     |    4 +++
 intel_display.c |   71 +++++++++++---------------------------------------------
 intel_dp.c      |   12 +++++++++
 intel_drv.h     |   20 +++++++++++++++
 intel_dvo.c     |    6 ++++
 intel_hdmi.c    |   18 +++++++++-----
 intel_lvds.c    |    2 +
 intel_sdvo.c    |   13 +++++++++-
 intel_tv.c      |    2 +
 9 files changed, 85 insertions(+), 63 deletions(-)

View full diff with command:
/usr/bin/cvs -n -f diff -kk -u -p -N -r 1.9 -r 1.10 drm-intel-next.patchIndex: drm-intel-next.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-intel-next.patch,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- drm-intel-next.patch	12 Aug 2009 15:58:25 -0000	1.9
+++ drm-intel-next.patch	26 Aug 2009 13:58:24 -0000	1.10
@@ -1,2653 +1,362 @@
-diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
-index 8c47831..50d1f78 100644
---- a/drivers/gpu/drm/i915/i915_dma.c
-+++ b/drivers/gpu/drm/i915/i915_dma.c
-@@ -1186,6 +1186,13 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- 	if (ret)
- 		goto out_iomapfree;
- 
-+	dev_priv->wq = create_workqueue("i915");
-+	if (dev_priv->wq == NULL) {
-+		DRM_ERROR("Failed to create our workqueue.\n");
-+		ret = -ENOMEM;
-+		goto out_iomapfree;
-+	}
-+
- 	/* enable GEM by default */
- 	dev_priv->has_gem = 1;
- 
-@@ -1211,7 +1218,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- 	if (!I915_NEED_GFX_HWS(dev)) {
- 		ret = i915_init_phys_hws(dev);
- 		if (ret != 0)
--			goto out_iomapfree;
-+			goto out_workqueue_free;
- 	}
- 
- 	i915_get_mem_freq(dev);
-@@ -1245,7 +1252,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- 		ret = i915_load_modeset_init(dev, prealloc_size, agp_size);
- 		if (ret < 0) {
- 			DRM_ERROR("failed to init modeset\n");
--			goto out_rmmap;
-+			goto out_workqueue_free;
- 		}
- 	}
- 
-@@ -1256,6 +1263,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
- 
- 	return 0;
- 
-+out_workqueue_free:
-+	destroy_workqueue(dev_priv->wq);
- out_iomapfree:
- 	io_mapping_free(dev_priv->mm.gtt_mapping);
- out_rmmap:
-@@ -1269,6 +1278,8 @@ int i915_driver_unload(struct drm_device *dev)
- {
- 	struct drm_i915_private *dev_priv = dev->dev_private;
- 
-+	destroy_workqueue(dev_priv->wq);
-+
- 	io_mapping_free(dev_priv->mm.gtt_mapping);
- 	if (dev_priv->mm.gtt_mtrr >= 0) {
- 		mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
-diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
-index d087528..7537f57 100644
---- a/drivers/gpu/drm/i915/i915_drv.h
-+++ b/drivers/gpu/drm/i915/i915_drv.h
-@@ -219,6 +219,7 @@ typedef struct drm_i915_private {
- 	unsigned int lvds_vbt:1;
- 	unsigned int int_crt_support:1;
- 	unsigned int lvds_use_ssc:1;
-+	unsigned int edp_support:1;
- 	int lvds_ssc_freq;
- 
- 	struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
-@@ -229,6 +230,8 @@ typedef struct drm_i915_private {
- 
- 	spinlock_t error_lock;
- 	struct drm_i915_error_state *first_error;
-+	struct work_struct error_work;
-+	struct workqueue_struct *wq;
- 
- 	/* Register state */
- 	u8 saveLBB;
-@@ -888,6 +891,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
- 						      IS_I915GM(dev)))
- #define SUPPORTS_INTEGRATED_HDMI(dev)	(IS_G4X(dev) || IS_IGDNG(dev))
- #define SUPPORTS_INTEGRATED_DP(dev)	(IS_G4X(dev) || IS_IGDNG(dev))
-+#define SUPPORTS_EDP(dev)		(IS_IGDNG_M(dev))
- #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev))
- /* dsparb controlled by hw only */
- #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev))
-diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
-index 5bf4203..140bee1 100644
---- a/drivers/gpu/drm/i915/i915_gem.c
-+++ b/drivers/gpu/drm/i915/i915_gem.c
-@@ -1570,7 +1570,7 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv,
- 	}
- 
- 	if (was_empty && !dev_priv->mm.suspended)
--		schedule_delayed_work(&dev_priv->mm.retire_work, HZ);
-+		queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
- 	return seqno;
- }
- 
-@@ -1719,7 +1719,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
- 	i915_gem_retire_requests(dev);
- 	if (!dev_priv->mm.suspended &&
- 	    !list_empty(&dev_priv->mm.request_list))
--		schedule_delayed_work(&dev_priv->mm.retire_work, HZ);
-+		queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, HZ);
- 	mutex_unlock(&dev->struct_mutex);
- }
- 
-diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c
-index 9a44bfc..cb3b974 100644
---- a/drivers/gpu/drm/i915/i915_gem_debugfs.c
-+++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c
-@@ -343,6 +343,8 @@ static int i915_error_state(struct seq_file *m, void *unused)
- 
- 	error = dev_priv->first_error;
- 
-+	seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
-+		   error->time.tv_usec);
- 	seq_printf(m, "EIR: 0x%08x\n", error->eir);
- 	seq_printf(m, "  PGTBL_ER: 0x%08x\n", error->pgtbl_er);
- 	seq_printf(m, "  INSTPM: 0x%08x\n", error->instpm);
-diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
-index 7ba23a6..83aee80 100644
---- a/drivers/gpu/drm/i915/i915_irq.c
-+++ b/drivers/gpu/drm/i915/i915_irq.c
-@@ -290,6 +290,35 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev)
- 	return ret;
- }
- 
-+/**
-+ * i915_error_work_func - do process context error handling work
-+ * @work: work struct
-+ *
-+ * Fire an error uevent so userspace can see that a hang or error
-+ * was detected.
-+ */
-+static void i915_error_work_func(struct work_struct *work)
-+{
-+	drm_i915_private_t *dev_priv = container_of(work, drm_i915_private_t,
-+						    error_work);
-+	struct drm_device *dev = dev_priv->dev;
-+	char *event_string = "ERROR=1";
-+	char *envp[] = { event_string, NULL };
-+
-+	DRM_DEBUG("generating error event\n");
-+
-+	kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, envp);
-+}
-+
-+/**
-+ * i915_capture_error_state - capture an error record for later analysis
-+ * @dev: drm device
-+ *
-+ * Should be called when an error is detected (either a hang or an error
-+ * interrupt) to capture error state from the time of the error.  Fills
-+ * out a structure which becomes available in debugfs for user level tools
-+ * to pick up.
-+ */
- static void i915_capture_error_state(struct drm_device *dev)
- {
- 	struct drm_i915_private *dev_priv = dev->dev_private;
-@@ -325,12 +354,137 @@ static void i915_capture_error_state(struct drm_device *dev)
- 		error->acthd = I915_READ(ACTHD_I965);
- 	}
- 
-+	do_gettimeofday(&error->time);
-+
- 	dev_priv->first_error = error;
- 
- out:
- 	spin_unlock_irqrestore(&dev_priv->error_lock, flags);
- }
- 
-+/**
-+ * i915_handle_error - handle an error interrupt
-+ * @dev: drm device
-+ *
-+ * Do some basic checking of regsiter state at error interrupt time and
-+ * dump it to the syslog.  Also call i915_capture_error_state() to make
-+ * sure we get a record and make it available in debugfs.  Fire a uevent
-+ * so userspace knows something bad happened (should trigger collection
-+ * of a ring dump etc.).
-+ */
-+static void i915_handle_error(struct drm_device *dev)
-+{
-+	struct drm_i915_private *dev_priv = dev->dev_private;
-+	u32 eir = I915_READ(EIR);
-+	u32 pipea_stats = I915_READ(PIPEASTAT);
-+	u32 pipeb_stats = I915_READ(PIPEBSTAT);
-+
-+	i915_capture_error_state(dev);
-+
-+	printk(KERN_ERR "render error detected, EIR: 0x%08x\n",
-+	       eir);
[...2568 lines suppressed...]
-+
-+		sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
-+		encoder->encoder_type = DRM_MODE_ENCODER_LVDS;
-+		connector->connector_type = DRM_MODE_CONNECTOR_LVDS;
-+		sdvo_priv->is_lvds = true;
-+	} else {
-+
-+		unsigned char bytes[2];
-+
-+		sdvo_priv->controlled_output = 0;
-+		memcpy(bytes, &sdvo_priv->caps.output_flags, 2);
-+		DRM_DEBUG_KMS(I915_SDVO,
-+				"%s: Unknown SDVO output type (0x%02x%02x)\n",
-+				  SDVO_NAME(sdvo_priv),
-+				  bytes[0], bytes[1]);
-+		ret = false;
-+	}
-+
-+	if (ret && registered)
-+		ret = drm_sysfs_connector_add(connector) == 0 ? true : false;
-+
-+
-+	return ret;
-+
-+}
-+
- bool intel_sdvo_init(struct drm_device *dev, int output_device)
- {
- 	struct drm_connector *connector;
- 	struct intel_output *intel_output;
- 	struct intel_sdvo_priv *sdvo_priv;
- 
--	int connector_type;
- 	u8 ch[0x40];
- 	int i;
--	int encoder_type;
+ 		unsigned char bytes[2];
+@@ -2009,6 +2019,7 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
+ 				  bytes[0], bytes[1]);
+ 		ret = false;
+ 	}
++	intel_output->crtc_mask = (1 << 0) | (1 << 1);
  
- 	intel_output = kcalloc(sizeof(struct intel_output)+sizeof(struct intel_sdvo_priv), 1, GFP_KERNEL);
+ 	if (ret && registered)
+ 		ret = drm_sysfs_connector_add(connector) == 0 ? true : false;
+diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
+index da4ab4d..2fbe13a 100644
+--- a/drivers/gpu/drm/i915/intel_tv.c
++++ b/drivers/gpu/drm/i915/intel_tv.c
+@@ -1718,6 +1718,7 @@ intel_tv_init(struct drm_device *dev)
  	if (!intel_output) {
-@@ -1925,88 +2075,28 @@ bool intel_sdvo_init(struct drm_device *dev, int output_device)
- 	intel_output->ddc_bus->algo = &intel_sdvo_i2c_bit_algo;
- 
- 	/* In defaut case sdvo lvds is false */
--	sdvo_priv->is_lvds = false;
- 	intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
- 
--	if (sdvo_priv->caps.output_flags &
--	    (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
--		if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
--			sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS0;
--		else
--			sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
--
--		encoder_type = DRM_MODE_ENCODER_TMDS;
--		connector_type = DRM_MODE_CONNECTOR_DVID;
--
--		if (intel_sdvo_get_supp_encode(intel_output,
--					       &sdvo_priv->encode) &&
--		    intel_sdvo_get_digital_encoding_mode(intel_output) &&
--		    sdvo_priv->is_hdmi) {
--			/* enable hdmi encoding mode if supported */
--			intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI);
--			intel_sdvo_set_colorimetry(intel_output,
--						   SDVO_COLORIMETRY_RGB256);
--			connector_type = DRM_MODE_CONNECTOR_HDMIA;
--		}
--	}
--	else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
--	{
--		sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
--		encoder_type = DRM_MODE_ENCODER_TVDAC;
--		connector_type = DRM_MODE_CONNECTOR_SVIDEO;
--		sdvo_priv->is_tv = true;
--		intel_output->needs_tv_clock = true;
--	}
--	else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
--	{
--		sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
--		encoder_type = DRM_MODE_ENCODER_DAC;
--		connector_type = DRM_MODE_CONNECTOR_VGA;
--	}
--	else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
--	{
--		sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
--		encoder_type = DRM_MODE_ENCODER_DAC;
--		connector_type = DRM_MODE_CONNECTOR_VGA;
--	}
--	else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0)
--	{
--		sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
--		encoder_type = DRM_MODE_ENCODER_LVDS;
--		connector_type = DRM_MODE_CONNECTOR_LVDS;
--		sdvo_priv->is_lvds = true;
--	}
--	else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
--	{
--		sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
--		encoder_type = DRM_MODE_ENCODER_LVDS;
--		connector_type = DRM_MODE_CONNECTOR_LVDS;
--		sdvo_priv->is_lvds = true;
--	}
--	else
--	{
--		unsigned char bytes[2];
--
--		sdvo_priv->controlled_output = 0;
--		memcpy (bytes, &sdvo_priv->caps.output_flags, 2);
--		DRM_DEBUG_KMS(I915_SDVO,
--				"%s: Unknown SDVO output type (0x%02x%02x)\n",
--				  SDVO_NAME(sdvo_priv),
--				  bytes[0], bytes[1]);
--		encoder_type = DRM_MODE_ENCODER_NONE;
--		connector_type = DRM_MODE_CONNECTOR_Unknown;
-+	if (intel_sdvo_output_setup(intel_output,
-+				    sdvo_priv->caps.output_flags) != true) {
-+		DRM_DEBUG("SDVO output failed to setup on SDVO%c\n",
-+			  output_device == SDVOB ? 'B' : 'C');
- 		goto err_i2c;
+ 		return;
  	}
- 
 +
  	connector = &intel_output->base;
- 	drm_connector_init(dev, connector, &intel_sdvo_connector_funcs,
--			   connector_type);
-+			   connector->connector_type);
-+
- 	drm_connector_helper_add(connector, &intel_sdvo_connector_helper_funcs);
- 	connector->interlace_allowed = 0;
- 	connector->doublescan_allowed = 0;
- 	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
- 
--	drm_encoder_init(dev, &intel_output->enc, &intel_sdvo_enc_funcs, encoder_type);
-+	drm_encoder_init(dev, &intel_output->enc,
-+			&intel_sdvo_enc_funcs, intel_output->enc.encoder_type);
-+
- 	drm_encoder_helper_add(&intel_output->enc, &intel_sdvo_helper_funcs);
  
+ 	drm_connector_init(dev, connector, &intel_tv_connector_funcs,
+@@ -1729,6 +1730,7 @@ intel_tv_init(struct drm_device *dev)
  	drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
-diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
-index a43c98e..da4ab4d 100644
---- a/drivers/gpu/drm/i915/intel_tv.c
-+++ b/drivers/gpu/drm/i915/intel_tv.c
-@@ -1490,6 +1490,27 @@ static struct input_res {
- 	{"1920x1080", 1920, 1080},
- };
- 
-+/*
-+ * Chose preferred mode  according to line number of TV format
-+ */
-+static void
-+intel_tv_chose_preferred_modes(struct drm_connector *connector,
-+			       struct drm_display_mode *mode_ptr)
-+{
-+	struct intel_output *intel_output = to_intel_output(connector);
-+	const struct tv_mode *tv_mode = intel_tv_mode_find(intel_output);
-+
-+	if (tv_mode->nbr_end < 480 && mode_ptr->vdisplay == 480)
-+		mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+	else if (tv_mode->nbr_end > 480) {
-+		if (tv_mode->progressive == true && tv_mode->nbr_end < 720) {
-+			if (mode_ptr->vdisplay == 720)
-+				mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+		} else if (mode_ptr->vdisplay == 1080)
-+				mode_ptr->type |= DRM_MODE_TYPE_PREFERRED;
-+	}
-+}
-+
- /**
-  * Stub get_modes function.
-  *
-@@ -1544,6 +1565,7 @@ intel_tv_get_modes(struct drm_connector *connector)
- 		mode_ptr->clock = (int) tmp;
- 
- 		mode_ptr->type = DRM_MODE_TYPE_DRIVER;
-+		intel_tv_chose_preferred_modes(connector, mode_ptr);
- 		drm_mode_probed_add(connector, mode_ptr);
- 		count++;
- 	}
+ 	tv_priv = (struct intel_tv_priv *)(intel_output + 1);
+ 	intel_output->type = INTEL_OUTPUT_TVOUT;
++	intel_output->clone_mask = (1 << INTEL_TV_CLONE_BIT);
+ 	intel_output->enc.possible_crtcs = ((1 << 0) | (1 << 1));
+ 	intel_output->enc.possible_clones = (1 << INTEL_OUTPUT_TVOUT);
+ 	intel_output->dev_priv = tv_priv;


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1739
retrieving revision 1.1740
diff -u -p -r1.1739 -r1.1740
--- kernel.spec	26 Aug 2009 10:06:27 -0000	1.1739
+++ kernel.spec	26 Aug 2009 13:58:24 -0000	1.1740
@@ -686,7 +686,7 @@ Patch1814: drm-nouveau.patch
 Patch1818: drm-i915-resume-force-mode.patch
 Patch1819: drm-intel-big-hammer.patch
 Patch1821: drm-page-flip.patch
-# anholt's tree as of 2009-08-12
+# anholt's tree as of 2009-08-26
 Patch1824: drm-intel-next.patch
 Patch1825: drm-intel-pm.patch
 Patch1826: drm-r600-kms.patch
@@ -1320,7 +1320,7 @@ ApplyPatch drm-nouveau.patch
 ApplyPatch drm-i915-resume-force-mode.patch
 ApplyPatch drm-intel-big-hammer.patch
 ApplyPatch drm-page-flip.patch
-#ApplyPatch drm-intel-next.patch
+ApplyPatch drm-intel-next.patch
 ApplyPatch drm-intel-pm.patch
 
 # VGA arb + drm
@@ -2015,6 +2015,9 @@ fi
 # and build.
 
 %changelog
+* Wed Aug 26 2009 Adam Jackson <ajax at redhat.com>
+- drm-intel-next.patch: Update, various output setup fixes.
+
 * Wed Aug 26 2009 David Woodhouse <David.Woodhouse at intel.com>
 - Make WiMAX modular (#512070)
 




More information about the scm-commits mailing list