rpms/kernel/devel drm-nouveau.patch, 1.50, 1.51 kernel.spec, 1.1788, 1.1789

Ben Skeggs bskeggs at fedoraproject.org
Thu Sep 10 05:35:19 UTC 2009


Author: bskeggs

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

Modified Files:
	drm-nouveau.patch kernel.spec 
Log Message:
* Thu Sep 10 2009 Ben Skeggs <bskeggs at redhat.com>
- drm-nouveau.patch: add some scaler-only modes for LVDS, GEM/TTM fixes



drm-nouveau.patch:
 drivers/gpu/drm/Kconfig                     |   45 
 drivers/gpu/drm/Makefile                    |    2 
 drivers/gpu/drm/drm_bufs.c                  |   28 
 drivers/gpu/drm/i2c/Makefile                |    4 
 drivers/gpu/drm/i2c/ch7006_drv.c            |  532 
 drivers/gpu/drm/i2c/ch7006_mode.c           |  473 
 drivers/gpu/drm/i2c/ch7006_priv.h           |  340 
 drivers/gpu/drm/nouveau/Makefile            |   27 
 drivers/gpu/drm/nouveau/nouveau_backlight.c |  155 
 drivers/gpu/drm/nouveau/nouveau_bios.c      | 5209 ++++++
 drivers/gpu/drm/nouveau/nouveau_bios.h      |  235 
 drivers/gpu/drm/nouveau/nouveau_bo.c        |  622 
 drivers/gpu/drm/nouveau/nouveau_calc.c      |  626 
 drivers/gpu/drm/nouveau/nouveau_channel.c   |  520 
 drivers/gpu/drm/nouveau/nouveau_connector.c |  747 
 drivers/gpu/drm/nouveau/nouveau_connector.h |   55 
 drivers/gpu/drm/nouveau/nouveau_crtc.h      |   95 
 drivers/gpu/drm/nouveau/nouveau_display.c   |  115 
 drivers/gpu/drm/nouveau/nouveau_dma.c       |  206 
 drivers/gpu/drm/nouveau/nouveau_dma.h       |  148 
 drivers/gpu/drm/nouveau/nouveau_drv.c       |  433 
 drivers/gpu/drm/nouveau/nouveau_drv.h       | 1202 +
 drivers/gpu/drm/nouveau/nouveau_encoder.h   |   66 
 drivers/gpu/drm/nouveau/nouveau_fb.h        |   47 
 drivers/gpu/drm/nouveau/nouveau_fbcon.c     |  355 
 drivers/gpu/drm/nouveau/nouveau_fbcon.h     |   48 
 drivers/gpu/drm/nouveau/nouveau_fence.c     |  261 
 drivers/gpu/drm/nouveau/nouveau_gem.c       |  954 +
 drivers/gpu/drm/nouveau/nouveau_hw.c        | 1077 +
 drivers/gpu/drm/nouveau/nouveau_hw.h        |  446 
 drivers/gpu/drm/nouveau/nouveau_i2c.c       |  256 
 drivers/gpu/drm/nouveau/nouveau_i2c.h       |   45 
 drivers/gpu/drm/nouveau/nouveau_ioc32.c     |   72 
 drivers/gpu/drm/nouveau/nouveau_irq.c       |  675 
 drivers/gpu/drm/nouveau/nouveau_mem.c       |  565 
 drivers/gpu/drm/nouveau/nouveau_notifier.c  |  194 
 drivers/gpu/drm/nouveau/nouveau_object.c    | 1279 +
 drivers/gpu/drm/nouveau/nouveau_reg.h       |  834 +
 drivers/gpu/drm/nouveau/nouveau_sgdma.c     |  317 
 drivers/gpu/drm/nouveau/nouveau_state.c     |  829 +
 drivers/gpu/drm/nouveau/nouveau_swmthd.h    |   33 
 drivers/gpu/drm/nouveau/nouveau_ttm.c       |  131 
 drivers/gpu/drm/nouveau/nv04_crtc.c         | 1014 +
 drivers/gpu/drm/nouveau/nv04_cursor.c       |   70 
 drivers/gpu/drm/nouveau/nv04_dac.c          |  525 
 drivers/gpu/drm/nouveau/nv04_dfp.c          |  621 
 drivers/gpu/drm/nouveau/nv04_display.c      |  293 
 drivers/gpu/drm/nouveau/nv04_fb.c           |   21 
 drivers/gpu/drm/nouveau/nv04_fbcon.c        |  292 
 drivers/gpu/drm/nouveau/nv04_fifo.c         |  295 
 drivers/gpu/drm/nouveau/nv04_graph.c        |  583 
 drivers/gpu/drm/nouveau/nv04_instmem.c      |  207 
 drivers/gpu/drm/nouveau/nv04_mc.c           |   20 
 drivers/gpu/drm/nouveau/nv04_timer.c        |   51 
 drivers/gpu/drm/nouveau/nv04_tv.c           |  304 
 drivers/gpu/drm/nouveau/nv10_fb.c           |   24 
 drivers/gpu/drm/nouveau/nv10_fifo.c         |  177 
 drivers/gpu/drm/nouveau/nv10_graph.c        |  945 +
 drivers/gpu/drm/nouveau/nv17_tv.c           |  660 
 drivers/gpu/drm/nouveau/nv17_tv.h           |  156 
 drivers/gpu/drm/nouveau/nv17_tv_modes.c     |  582 
 drivers/gpu/drm/nouveau/nv20_graph.c        |  784 
 drivers/gpu/drm/nouveau/nv40_fb.c           |   62 
 drivers/gpu/drm/nouveau/nv40_fifo.c         |  223 
 drivers/gpu/drm/nouveau/nv40_graph.c        | 2203 ++
 drivers/gpu/drm/nouveau/nv40_mc.c           |   38 
 drivers/gpu/drm/nouveau/nv50_crtc.c         |  799 +
 drivers/gpu/drm/nouveau/nv50_cursor.c       |  151 
 drivers/gpu/drm/nouveau/nv50_dac.c          |  296 
 drivers/gpu/drm/nouveau/nv50_display.c      |  905 +
 drivers/gpu/drm/nouveau/nv50_display.h      |   46 
 drivers/gpu/drm/nouveau/nv50_evo.h          |  113 
 drivers/gpu/drm/nouveau/nv50_fbcon.c        |  256 
 drivers/gpu/drm/nouveau/nv50_fifo.c         |  475 
 drivers/gpu/drm/nouveau/nv50_graph.c        |  439 
 drivers/gpu/drm/nouveau/nv50_grctx.h        |22284 ++++++++++++++++++++++++++++
 drivers/gpu/drm/nouveau/nv50_instmem.c      |  499 
 drivers/gpu/drm/nouveau/nv50_mc.c           |   40 
 drivers/gpu/drm/nouveau/nv50_sor.c          |  250 
 drivers/gpu/drm/nouveau/nvreg.h             |  535 
 drivers/gpu/drm/ttm/ttm_bo.c                |    4 
 include/drm/Kbuild                          |    1 
 include/drm/drmP.h                          |    2 
 include/drm/i2c/ch7006.h                    |   86 
 include/drm/nouveau_drm.h                   |  216 
 85 files changed, 57829 insertions(+), 21 deletions(-)

Index: drm-nouveau.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/drm-nouveau.patch,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -p -r1.50 -r1.51
--- drm-nouveau.patch	9 Sep 2009 06:41:33 -0000	1.50
+++ drm-nouveau.patch	10 Sep 2009 05:35:18 -0000	1.51
@@ -8930,10 +8930,10 @@ index 0000000..7761425
 +int nouveau_max_ioctl = DRM_ARRAY_SIZE(nouveau_ioctls);
 diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
 new file mode 100644
-index 0000000..6bb5528
+index 0000000..7f799f6
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
-@@ -0,0 +1,689 @@
+@@ -0,0 +1,747 @@
 +/*
 + * Copyright (C) 2008 Maarten Maathuis.
 + * All Rights Reserved.
@@ -9323,6 +9323,61 @@ index 0000000..6bb5528
 +	return NULL;
 +}
 +
++struct moderec {
++	int hdisplay;
++	int vdisplay;
++};
++
++static struct moderec scaler_modes[] = {
++	{ 1920, 1440 },
++	{ 1920, 1280 },
++	{ 1600, 1200 },
++	{ 1400, 1050 },
++	{ 1280, 1024 },
++	{ 1280, 960 },
++	{ 1152, 864 },
++	{ 1024, 768 },
++	{ 800, 600 },
++	{ 720, 400 },
++	{ 640, 480 },
++	{ 640, 400 },
++	{ 640, 350 },
++	{}
++};
++
++static int
++nouveau_connector_scaler_modes_add(struct drm_connector *connector)
++{
++	struct nouveau_connector *nv_connector = nouveau_connector(connector);
++	struct drm_display_mode *native = nv_connector->native_mode, *m;
++	struct drm_device *dev = connector->dev;
++	struct moderec *mode = &scaler_modes[0];
++	int modes = 0;
++
++	if (!native)
++		return 0;
++
++	while (mode->hdisplay) {
++		if (mode->hdisplay <= native->hdisplay &&
++		    mode->vdisplay <= native->vdisplay) {
++			m = drm_cvt_mode(dev, mode->hdisplay, mode->vdisplay,
++					 drm_mode_vrefresh(native), false,
++					 false);
++			if (!m)
++				continue;
++
++			m->type |= DRM_MODE_TYPE_DRIVER;
++
++			drm_mode_probed_add(connector, m);
++			modes++;
++		}
++
++		mode++;
++	}
++
++	return modes;
++}
++
 +static int
 +nouveau_connector_get_modes(struct drm_connector *connector)
 +{
@@ -9362,6 +9417,9 @@ index 0000000..6bb5528
 +		ret = get_slave_funcs(nv_encoder)->
 +			get_modes(to_drm_encoder(nv_encoder), connector);
 +
++	if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
++		ret += nouveau_connector_scaler_modes_add(connector);
++
 +	return ret;
 +}
 +
@@ -10713,10 +10771,10 @@ index 0000000..f2b8b17
 +MODULE_LICENSE("GPL and additional rights");
 diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
 new file mode 100644
-index 0000000..abf7f8e
+index 0000000..57e8db3
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
-@@ -0,0 +1,1201 @@
+@@ -0,0 +1,1202 @@
 +/*
 + * Copyright 2005 Stephane Marchesin.
 + * All Rights Reserved.
@@ -10787,6 +10845,7 @@ index 0000000..abf7f8e
 +	struct ttm_bo_kmap_obj kmap;
 +	struct list_head head;
 +
++	struct drm_file *reserved_by;
 +	struct list_head entry;
 +
 +	struct nouveau_channel *channel;
@@ -10877,8 +10936,7 @@ index 0000000..abf7f8e
 +	int handle;
 +};
 +
-+struct nouveau_channel
-+{
++struct nouveau_channel {
 +	struct drm_device *dev;
 +	int id;
 +
@@ -11203,6 +11261,7 @@ index 0000000..abf7f8e
 +		struct ttm_bo_device bdev;
 +		spinlock_t bo_list_lock;
 +		struct list_head bo_list;
++		atomic_t validate_sequence;
 +	} ttm;
 +
 +	struct fb_info *fbdev_info;
@@ -12727,10 +12786,10 @@ index 0000000..230a99b
 +
 diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
 new file mode 100644
-index 0000000..226eca2
+index 0000000..0b2c044
 --- /dev/null
 +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
-@@ -0,0 +1,942 @@
+@@ -0,0 +1,954 @@
 +/*
 + * Copyright (C) 2008 Ben Skeggs.
 + * All Rights Reserved.
@@ -12971,9 +13030,10 @@ index 0000000..226eca2
 +	list_for_each_safe(entry, tmp, list) {
 +		nvbo = list_entry(entry, struct nouveau_bo, entry);
 +
-+		drm_gem_object_unreference(nvbo->gem);
-+		ttm_bo_unreserve(&nvbo->bo);
 +		list_del(&nvbo->entry);
++		nvbo->reserved_by = NULL;
++		ttm_bo_unreserve(&nvbo->bo);
++		drm_gem_object_unreference(nvbo->gem);
 +	}
 +}
 +
@@ -12992,9 +13052,10 @@ index 0000000..226eca2
 +		nvbo->bo.sync_obj = nouveau_fence_ref(fence);
 +		spin_unlock(&nvbo->bo.lock);
 +
-+		drm_gem_object_unreference(nvbo->gem);
-+		ttm_bo_unreserve(&nvbo->bo);
 +		list_del(&nvbo->entry);
++		nvbo->reserved_by = NULL;
++		ttm_bo_unreserve(&nvbo->bo);
++		drm_gem_object_unreference(nvbo->gem);
 +
 +		nouveau_fence_unref((void *)&prev_fence);
 +	}
@@ -13007,6 +13068,7 @@ index 0000000..226eca2
 +			     uint64_t user_buffers, int nr_buffers,
 +			     struct list_head *list, int *apply_relocs)
 +{
++	struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
 +	struct drm_device *dev = chan->dev;
 +	struct drm_nouveau_gem_pushbuf_bo *b;
 +	struct drm_nouveau_gem_pushbuf_bo __user *user_pbbos =
@@ -13014,6 +13076,7 @@ index 0000000..226eca2
 +	struct nouveau_fence *prev_fence;
 +	struct nouveau_bo *nvbo;
 +	struct list_head *entry, *tmp;
++	uint32_t sequence;
 +	int ret = -EINVAL;
 +	int i;
 +	int trycnt = 0;
@@ -13021,6 +13084,7 @@ index 0000000..226eca2
 +	if (nr_buffers == 0)
 +		return 0;
 +
++	sequence = atomic_add_return(1, &dev_priv->ttm.validate_sequence);
 +retry:
 +	if (++trycnt > 100000) {
 +		ret = -EINVAL;
@@ -13039,8 +13103,14 @@ index 0000000..226eca2
 +		}
 +		nvbo = gem->driver_private;
 +
-+		ret = ttm_bo_reserve(&nvbo->bo, false, false, true,
-+				     chan->fence.sequence);
++		if (nvbo->reserved_by && nvbo->reserved_by == file_priv) {
++			NV_INFO(dev, "multiple instances of buffer %d on "
++				     "validation list\n", b->handle);
++			ret = -EINVAL;
++			goto out_unref;
++		}
++
++		ret = ttm_bo_reserve(&nvbo->bo, false, false, true, sequence);
 +		if (ret) {
 +			nouveau_gem_pushbuf_backoff(list);
 +			if (ret == -EAGAIN)
@@ -13051,6 +13121,7 @@ index 0000000..226eca2
 +			goto retry;
 +		}
 +
++		nvbo->reserved_by = file_priv;
 +		list_add_tail(&nvbo->entry, list);
 +
 +		if (unlikely(atomic_read(&nvbo->bo.cpu_writers) > 0)) {


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1788
retrieving revision 1.1789
diff -u -p -r1.1788 -r1.1789
--- kernel.spec	10 Sep 2009 04:15:19 -0000	1.1788
+++ kernel.spec	10 Sep 2009 05:35:19 -0000	1.1789
@@ -2010,6 +2010,9 @@ fi
 # and build.
 
 %changelog
+* Thu Sep 10 2009 Ben Skeggs <bskeggs at redhat.com>
+- drm-nouveau.patch: add some scaler-only modes for LVDS, GEM/TTM fixes
+
 * Wed Sep 09 2009 Dennis Gilmore <dennis at ausil.us> 2.6.31-2
 - touch the dracut initrd file when using %%{with_dracut}
 




More information about the scm-commits mailing list