Skip to contentSkip to conversation

DRM changes

DISCUSSION Stephane Marchesin 5 participants 9 messages Mar 9, 2009 – Mar 31, 2009 5 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

As part of aiming at upstreaming our code, I suppose we have to discuss the DRM situation a little. In order to aim for merging, I think we'd better be working on a linux kernel tree layout. And considering we're technically the only ones still working in drm.git, it doesn't really make sense to keep doing that for the sake of sharing code with other drivers.

As we discussed on irc, there would be multiple changes related to this:
- we move to a linux kernel-like tree, that should make it easier when upstreaming the code.
- this new tree is hosted in freedekstop.org in the nouveau/ git so we don't need additional accounts for everyone all around and people can keep pushing things (even better, all nouveau people can push to the drm, which used to require mesa rights before)
- we keep a(some) branch(es) in the tree for backwards compat with older kernels. Either in the form of separate kernel versions including nouveau, or in the form of an out-of-tree-compilable drm/nouveau module.

So, does that plan sound sane? Do you have better plans?

Stephane

A message that is not in the archive (sent off-list or not yet received): 6a89f9d50903091449w47c8a79ak37124972b91a6fde-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#2 lore raw

Questions:

A tree based on what? (linus, drm-next, etc)

What happens to shared-core?

Opinions (assuming this happens):

I'd do a branch for each kernel version (or less if needed), and let people who care cherry-pick fixes.

Maarten.

A message that is not in the archive (sent off-list or not yet received): 6d4bc9fc0903091523n4eff7715oe5249ebb799e298-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 4 lines · Maarten Maathuis

Questions:

A tree based on what? (linus, drm-next, etc)

I would follow drm-next, but I don't think it is very relevant at this point, since anyway drm-next periodically merges to linus. If there are reasons to choose one over the other, I'm interested in hearing them.

Quoted 1 line

What happens to shared-core?

It will probably meet its creator.

Quoted 6 lines

Opinions (assuming this happens):

I'd do a branch for each kernel version (or less if needed), and let people who care cherry-pick fixes.

Yeah that's what I initially thought, but Pekka said you could also get an out-of-tree build from a full kernel tree. So that's the two paths to explore.

Stephane

#5 lore raw
In reply to a message not in the archive

mån 2009-03-09 klockan 22:49 +0100 skrev Stephane Marchesin:

Quoted 5 lines

Hi,

So, does that plan sound sane? Do you have better plans?

Stephane

I must say that for me it does not give that big problems, since I already are using my own hem-brewed kernel. But I think it will be harder getting testers if they need to not just compile som modules for their kernel, but also try to configure the beast on their own.

Just my 2-cents.

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 11 lines · Peter Hjalmarsson

mån 2009-03-09 klockan 22:49 +0100 skrev Stephane Marchesin:

Quoted 5 lines

Hi,

So, does that plan sound sane? Do you have better plans?

Stephane

I must say that for me it does not give that big problems, since I already are using my own hem-brewed kernel. But I think it will be harder getting testers if they need to not just compile som modules for their kernel, but also try to configure the beast on their own.

Lets face it, users who can't configure their own kernel will probably turn out to be bad testers. And besides, configuring a kernel is not that hard, and users can just copy their distro's configuration and only tweak the drm related parts. No show stoppers here.

Cheers,
Renato

A message that is not in the archive (sent off-list or not yet received): 1caff7430903140418k434fc82es7927d7015026cea3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#9 lore raw

lör 2009-03-14 klockan 11:18 +0000 skrev Renato Caldas:

Quoted 13 lines · Peter Hjalmarsson
Quoted 11 lines

mån 2009-03-09 klockan 22:49 +0100 skrev Stephane Marchesin:

Quoted 5 lines

Hi,

So, does that plan sound sane? Do you have better plans?

Stephane

I must say that for me it does not give that big problems, since I already are using my own hem-brewed kernel. But I think it will be harder getting testers if they need to not just compile som modules for their kernel, but also try to configure the beast on their own.

Quoted 7 lines

Lets face it, users who can't configure their own kernel will probably turn out to be bad testers. And besides, configuring a kernel is not that hard, and users can just copy their distro's configuration and only tweak the drm related parts. No show stoppers here.

Cheers,
Renato

I know many who are good enought to be good testers and are programmers but could care less about having to update their kernel, patch it and/or reconfigure it every time someone finds a security-related bug or broken feature and WANT someone (i.e. the distribution) to do that work for them. They just want to use their computer to what they want: code programs, not spend time on their configuration if they do not have to.

Even if they can copy the configuration from their distribution, the question is if they want to spend time on tracking the kernel, patch it and so on if they had to.

I do not know if I have hadthe time to do that if it was not for having a good working configuration and having gentoo tracking and patching it for me.
And with the current development-speed of nouveau: do we want testers that only update when they have that amount of time, it would take long time to bisect those historys if/when something breaks.
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): [email protected]

#12 lore raw

Building rawhide+darktama on 2.6.24 (Re: DRM changes)

In reply to a message not in the archive
Quoted 11 lines · On Mon, 9 Mar 2009 22:49:32 +0100 Stephane Marchesin…

As we discussed on irc, there would be multiple changes related to this:
- we move to a linux kernel-like tree, that should make it easier when upstreaming the code.
- this new tree is hosted in freedekstop.org in the nouveau/ git so we don't need additional accounts for everyone all around and people can keep pushing things (even better, all nouveau people can push to the drm, which used to require mesa rights before)
- we keep a(some) branch(es) in the tree for backwards compat with older kernels. Either in the form of separate kernel versions including nouveau, or in the form of an out-of-tree-compilable drm/nouveau module.

Hi,

I took airlied's drm-rawhide kernel tree, applied darktama's patch that adds Nouveau, wrote/copied my own compat-patches on top of that, and compiled the DRM modules (drm.ko and nouveau.ko) against my currently running kernel 2.6.24.

It works, with the caveat that I needed a tiny patch to 2.6.24 in addition to reconfiguring it. The details will follow. I've been running Nouveau for two hours now without any hickups.

I'm CC'ing also dri-devel@ just in case people working on other drivers might be interested in offering a "drm.git-like" version of their drivers for people with older, custom or otherwise not-this-driver's-development-tree kernels. And because my compat patches probably suck.

Feel free to drop the dri-devel@ CC when you discuss Nouveau-only matters.

This raises some questions for Nouveau:
- like marcheu proposed, shall Nouveau DRM move into a kernel tree?
- do we abandon drm.git kernel directories completely?
- is the out-of-tree DRM build sketched below feasible for users?
- how do we maintain and distribute the compat patches and DRM code?

I'd expect the compat patches would be maintained by whoever happens to run older kernels. Developers do not consider compat patching.

Building DRM out-of-tree for 2.6.24:

Prepare the "upstream" DRM and Nouveau code:

- Get airlied's linux kernel tree, the drm-rawhide branch:
http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=shortlog;h=drm-rawhide
(the version I used is probably a week old now)

- Get darktama's nouveau patch and apply it on drm-rawhide:
http://cvs.fedoraproject.org/viewvc/rpms/kernel/devel/drm-nouveau.patch?revision=1.25&view=markup
(this is probably outdated by now)

- apply the included nouveau-drm-compat-24.patch
This patch is combined from the individual patches listed in its description, diffstat is included.

- run 'make clean' unless your tree is already clean.

Prepare your 2.6.24 kernel:

- apply the included kernel-compat-24.patch to export shmem_file_setup()

- configure the following as modules:
CONFIG_DRM
CONFIG_FB
CONFIG_BACKLIGHT_CLASS_DEVICE
CONFIG_FB_SAVAGE
The savage driver is abused to get FB_CFB_FILLRECT, FB_CFB_COPYAREA and FB_CFB_IMAGEBLIT enabled, since they do not have menuconfig entries. If you actually have a Savage card in your computer, maybe you should pick another fb driver.

- build and install as usual, remove the drm.ko generated.

Building the DRM and Nouveau modules as external modules using the 2.6.24 kernel tree:

- save the included mkbuild-nouveau.bash script

- edit the script, and fix the paths to the 2.6.24 and the drm-rawhide kernel trees

- create a new empty directory and cd into it

- run '../mkbuild-nouveau.bash init', it should not whine about anything, just print good stuff.

- run '../mkbuild-nouveau.bash build', it should build drm.ko and nouveau.ko. These are probably created in the drm-rawhide kernel tree.

- find the kernel modules, and load these:
fb.ko
drm.ko
backlight.ko
cfbcopyarea.ko
cfbfillrect.ko
cfbimgblt.ko
nouveau.ko
Now the Nouveau DDX should run just fine using the new DRM modules.

Ben, I still don't see any comment from you on this thread :-)

Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/

#!/bin/bash

# 395e0ddc44005ced5e4fed9bfc2e4bdf63d37627 shmem_file_setup export

# Use e.g. CONFIG_FB_SAVAGE to get FB_CFB_FILLRECT, FB_CFB_COPYAREA

# and FB_CFB_IMAGEBLIT.
# cd into an empty directory, and call this script from there.

# Path to the kernel tree, from which DRM is built. NKDIR="/home/pq/linux/linux-2.6-torvalds"

# Path to the configured kernel tree you normally use KDIR="$(readlink -f /lib/modules/uname -r/source)"

# All resulting files *should* be written to OUTDIR, but it seems

# the external module directory does not honour that. I.e. the
# the external modules are built into DRMDIR.

DRMDIR="$NKDIR/drivers/gpu/drm"
OUTDIR="$(pwd)"
NEWCONFIG="$OUTDIR/.config"

# --- nothing configurable below this line ---

CMD="$1"

function config_check_ym {
	OPTION="$1"
	grep -q -e "CONFIG_$OPTION=[ym]" "$NEWCONFIG" && return 0
	echo "Option CONFIG_$OPTION is not set in your kernel config."
	return 1
}
function config_require {
	local FAIL=0
	for REQ in "$@"; do
		config_check_ym "$REQ" || FAIL=1
	done
	return $FAIL
}
function die {
	echo "$@"
	exit 1
}
function kmake {
	make -C "$KDIR" O="$OUTDIR" "$@"
}
function kmake_drm {
	kmake M="$DRMDIR" EXTRA_CFLAGS="-I$NKDIR/include/drm" "$@"
}
echo "KDIR     $KDIR"
echo "DRMDIR   $DRMDIR"
echo "OUTDIR   $OUTDIR"

echo ""

REQCFG="DRM FB BACKLIGHT_CLASS_DEVICE FB_CFB_FILLRECT FB_CFB_COPYAREA FB_CFB_IMAGEBLIT"

case "$CMD" in

	init)
		cp "$KDIR/.config" "$NEWCONFIG"
		cp -a "$KDIR/scripts" "$OUTDIR/scripts"
		kmake silentoldconfig
		#echo -e "\nCONFIG_DRM_NOUVEAU=m" >> "$NEWCONFIG"
		config_require $REQCFG || \
			die "Please, fix you kernel config to have: $REQCFG"
		;;
	build)
		kmake_drm drm.ko || \
			die "making drm.ko failed"
		kmake_drm nouveau/nouveau.ko || \
			die "making nouveau.ko failed"
		;;
	clean)
		kmake_drm clean
		;;
	*)
		echo "Unknown command: '$CMD'"
		echo "Supported commands: init build clean"
		echo "Please edit the script to configure it."
		exit 1

esac

Individual patches:

eae74f67e610b122b83344160fe6824f4d1fb157 nouveau compat: fix nouveau_backlight.c 643a6631225572577bb978bf680a8e62494cdb72 nouveau compat: fix nouveau_bo.c d50c7807a9632f4b000880dd336f33d9d75bd86b nouveau compat: fix nouveau_sgdma.c b721c48a61ad772aa35677a7a317838174dc388e nouveau compat: fix nouveau_object.c 9d1a9ea342b66bc890445f7ac1c1a3252daf0c48 nouveau compat: fix nouveau_state.c 4a5584e5dacbbab61f603b7f0aeac15373ee2c64 drm: hardwire nouveau to be built as a module 97f0b94f347584587d596a9c1d69995787d71682 drm: fix printf fmt in drm_bo.c d0841aeb4a16b5da475665325c99462e6d17735f drm compat: fix drm_page_alloc.c c1f22a2e71c37eaabe69998f65edc6e6abffd32c drm: functions in drm_compat.h must be static 560683d84115ff7bec3244c17feec866716eead9 drm compat: fix drm_bo_move.c 5d9c1ffc5458657fd9ef32b1b93081bca41cf595 drm compat: fix drm_ttm.c 3f5598aff86054e7b371c0cdb8549fb0ed8d2333 drm compat: fix drm_crtc_helper.c e5e671c53fa493c1fa15960ba3480f877e6ef2f2 drm compat: fix drm_sysfs.c 68f6da44fe096291e5a0deb023e122a635a9fa37 drm: drm_compat.c needs drm_compat.h included b3ecc3eed2c1e8e9d1470148e13bd330dc83eb4f drm compat: fix ati_pcigart.c 747bc5fd7fbe4934f5216058264b08ebb37f2d49 drm compat: fix drm_agpsupport.c 4ffe8e87f3525aac2f1bea0cf2987e67a3d3fe22 drm compat: fix drm_vm.c d0314bca55ac5c267210fa7174db4520f1930fee drm compat: fix drm_memory.c bad5327061659deb0022ef0e077aea23fdbcf98f drm compat: fix drm_fops.c 3c6581e9dbae013d2b5f475d57d02cdaf6a64319 drm compat: fix drm_gem.c 08d9dc3bd1f46e84bf5e1f541c4e823dfe984c95 drm compat: drm_compat.h needs version.h d13a7913ec92cfc70294f6882bad58fcd5ddd2dc drm: add drm_compat.[ch]

 drivers/gpu/drm/Makefile                    |    3 +-
 drivers/gpu/drm/ati_pcigart.c               |    1 +
 drivers/gpu/drm/drm_agpsupport.c            |    1 +
 drivers/gpu/drm/drm_bo.c                    |    4 +-
 drivers/gpu/drm/drm_bo_move.c               |    3 +-
 drivers/gpu/drm/drm_compat.c                |  267 +++++++++++++++++++++++++
 drivers/gpu/drm/drm_compat.h                |  289 +++++++++++++++++++++++++++
 drivers/gpu/drm/drm_crtc_helper.c           |    1 +
 drivers/gpu/drm/drm_fops.c                  |    1 +
 drivers/gpu/drm/drm_gem.c                   |    1 +
 drivers/gpu/drm/drm_memory.c                |    1 +
 drivers/gpu/drm/drm_page_alloc.c            |    1 +
 drivers/gpu/drm/drm_sysfs.c                 |    1 +
 drivers/gpu/drm/drm_ttm.c                   |    1 +
 drivers/gpu/drm/drm_vm.c                    |    3 +-
 drivers/gpu/drm/nouveau/Makefile            |    2 +-
 drivers/gpu/drm/nouveau/nouveau_backlight.c |    5 +
 drivers/gpu/drm/nouveau/nouveau_bo.c        |    1 +
 drivers/gpu/drm/nouveau/nouveau_object.c    |    1 +
 drivers/gpu/drm/nouveau/nouveau_sgdma.c     |    1 +
 drivers/gpu/drm/nouveau/nouveau_state.c     |    5 +
 21 files changed, 587 insertions(+), 6 deletions(-)
drivers/gpu/drm/Makefile +2 -1
index 97aa0c8..6a937dd 100644
@@ -12,6 +12,7 @@ drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
 		drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o \
 		drm_crtc.o drm_crtc_helper.o drm_modes.o drm_edid.o \
 		drm_info.o drm_debugfs.o \
+		drm_compat.o \
 		drm_fence.o drm_bo.o drm_ttm.o drm_bo_move.o drm_page_alloc.o
 
 drm-$(CONFIG_COMPAT) += drm_ioc32.o
@@ -27,5 +28,5 @@ obj-$(CONFIG_DRM_I915)  += i915/
 obj-$(CONFIG_DRM_SIS)   += sis/
 obj-$(CONFIG_DRM_SAVAGE)+= savage/
 obj-$(CONFIG_DRM_VIA)	+=via/
-obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
+obj-m +=nouveau/
 
drivers/gpu/drm/ati_pcigart.c +1 -0
index e7dc671..597f4ef 100644
@@ -32,6 +32,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 
 # define ATI_PCIGART_PAGE_SIZE		4096	/**< PCI GART page size */
 # define ATI_PCIGART_PAGE_MASK		(~(ATI_PCIGART_PAGE_SIZE-1))
drivers/gpu/drm/drm_agpsupport.c +1 -0
index 851f4c3..a7bc525 100644
@@ -32,6 +32,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #include <linux/module.h>
 
 #if __OS_HAS_AGP
drivers/gpu/drm/drm_bo.c +2 -2
index 371db56..19b50fc 100644
@@ -511,7 +511,7 @@ static void drm_bo_delayed_delete(struct drm_device *dev, int remove_all)
 		entry = list_entry(list, struct drm_buffer_object, ddestroy);
 
 		nentry = NULL;
-		DRM_DEBUG("bo is %p, %d\n", entry, entry->num_pages);
+		DRM_DEBUG("bo is %p, %lu\n", entry, entry->num_pages);
 		if (next != &bm->ddestroy) {
 			nentry = list_entry(next, struct drm_buffer_object,
 					    ddestroy);
@@ -1265,7 +1265,7 @@ static int drm_buffer_object_validate(struct drm_buffer_object *bo,
 					 move_unfenced);
 		if (ret) {
 			if (ret != -EAGAIN)
-				DRM_ERROR("Failed moving buffer. %p %d %llx %llx\n", bo, bo->num_pages, bo->mem.proposed_flags, bo->mem.flags );
+				DRM_ERROR("Failed moving buffer. %p %lu %llx %llx\n", bo, bo->num_pages, bo->mem.proposed_flags, bo->mem.flags );
 			if (ret == -ENOMEM)
 				DRM_ERROR("Out of aperture space or "
 					  "DRM memory quota.\n");
drivers/gpu/drm/drm_bo_move.c +2 -1
index abeab6a..fe9d635 100644
@@ -29,8 +29,9 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 
-#if defined(CONFIG_X86)
+#if defined(CONFIG_X86) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
 #include <asm/pat.h>
 #endif
 
drivers/gpu/drm/drm_compat.c new file +267 -0

267 lines not on this page · raw message

drivers/gpu/drm/drm_compat.h new file +289 -0

289 lines not on this page · raw message

drivers/gpu/drm/drm_crtc_helper.c +1 -0
index 3b78927..d30087c 100644
@@ -30,6 +30,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
 
drivers/gpu/drm/drm_fops.c +1 -0
index 4f1a405..1b6089b 100644
@@ -35,6 +35,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #include <linux/poll.h>
 #include <linux/smp_lock.h>
 
drivers/gpu/drm/drm_gem.c +1 -0
index 2e4e667..61403f1 100644
@@ -35,6 +35,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include "drmP.h"
+#include "drm_compat.h"
 
 /** @file drm_gem.c
  *
drivers/gpu/drm/drm_memory.c +1 -0
index 4942f9d..19ee7ab 100644
@@ -35,6 +35,7 @@
 
 #include <linux/highmem.h>
 #include "drmP.h"
+#include "drm_compat.h"
 
 
 static struct {
drivers/gpu/drm/drm_page_alloc.c +1 -0
index fad6ae3..83d63d8 100644
@@ -32,6 +32,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #include <asm/agp.h>
 
 #include "drm_page_alloc.h"
drivers/gpu/drm/drm_sysfs.c +1 -0
index f7510a8..bd9d57d 100644
@@ -18,6 +18,7 @@
 
 #include "drm_core.h"
 #include "drmP.h"
+#include "drm_compat.h"
 
 #define to_drm_minor(d) container_of(d, struct drm_minor, kdev)
 #define to_drm_connector(d) container_of(d, struct drm_connector, kdev)
drivers/gpu/drm/drm_ttm.c +1 -0
index ec5f140..cfc829b 100644
@@ -29,6 +29,7 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #include <asm/agp.h>
 
 /**
drivers/gpu/drm/drm_vm.c +2 -1
index 9443402..26caec9 100644
@@ -34,10 +34,11 @@
  */
 
 #include "drmP.h"
+#include "drm_compat.h"
 #if defined(__ia64__)
 #include <linux/efi.h>
 #endif
-#if defined(CONFIG_X86)
+#if defined(CONFIG_X86) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
 #include <asm/pat.h>
 #endif
 
drivers/gpu/drm/nouveau/Makefile +1 -1
index 12af41b..4bb91c6 100644
@@ -21,4 +21,4 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_fifo.o nouveau_mem.o \
 
 nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 
-obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o
+obj-m += nouveau.o
drivers/gpu/drm/nouveau/nouveau_backlight.c +5 -0
index 3fc521e..865440f 100644
@@ -31,6 +31,7 @@
  */
 
 #include <linux/backlight.h>
+#include <linux/version.h>
 
 #include "drmP.h"
 #include "nouveau_drv.h"
@@ -60,7 +61,9 @@ static int nv40_set_intensity(struct backlight_device *bd)
 }
 
 static struct backlight_ops nv40_bl_ops = {
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28))
 	.options = BL_CORE_SUSPENDRESUME,
+#endif
 	.get_brightness = nv40_get_intensity,
 	.update_status = nv40_set_intensity,
 };
@@ -85,7 +88,9 @@ static int nv50_set_intensity(struct backlight_device *bd)
 }
 
 static struct backlight_ops nv50_bl_ops = {
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28))
 	.options = BL_CORE_SUSPENDRESUME,
+#endif
 	.get_brightness = nv50_get_intensity,
 	.update_status = nv50_set_intensity,
 };
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -0
index dc52670..30f45d4 100644
@@ -31,6 +31,7 @@
 #include "nouveau_drm.h"
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
+#include "../drm_compat.h"
 
 static struct drm_ttm_backend *
 nouveau_bo_create_ttm_backend_entry(struct drm_device * dev)
drivers/gpu/drm/nouveau/nouveau_object.c +1 -0
index 068797b..b74e94f 100644
@@ -34,6 +34,7 @@
 #include "drm.h"
 #include "nouveau_drv.h"
 #include "nouveau_drm.h"
+#include "../drm_compat.h"
 
 /* NVidia uses context objects to drive drawing operations.
 
drivers/gpu/drm/nouveau/nouveau_sgdma.c +1 -0
index 3be7235..b7861e9 100644
@@ -1,6 +1,7 @@
 #include "drmP.h"
 #include "nouveau_drv.h"
 #include <linux/pagemap.h>
+#include "../drm_compat.h"
 
 #define NV_CTXDMA_PAGE_SHIFT 12
 #define NV_CTXDMA_PAGE_SIZE  (1 << NV_CTXDMA_PAGE_SHIFT)
drivers/gpu/drm/nouveau/nouveau_state.c +5 -0
index 2988664..91c393a 100644
@@ -23,7 +23,12 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
+#include <asm/byteorder.h>
+#else
 #include <linux/swab.h>
+#endif
 
 #include "drmP.h"
 #include "drm.h"
shmem.c renamed from shmem-orig.c +1 -0
@@ -2562,6 +2562,7 @@ put_memory:
 	shmem_unacct_size(flags, size);
 	return ERR_PTR(error);
 }
+EXPORT_SYMBOL_GPL(shmem_file_setup);
 
 /*
  * shmem_zero_setup - setup a shared anonymous mapping

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#13 lore raw
In reply to a message not in the archive
Quoted 21 lines · On Mon, 9 Mar 2009 22:49:32 +0100 Stephane Marchesin…

Hi,

As part of aiming at upstreaming our code, I suppose we have to discuss the DRM situation a little. In order to aim for merging, I think we'd better be working on a linux kernel tree layout. And considering we're technically the only ones still working in drm.git, it doesn't really make sense to keep doing that for the sake of sharing code with other drivers.

As we discussed on irc, there would be multiple changes related to this:
- we move to a linux kernel-like tree, that should make it easier when upstreaming the code.
- this new tree is hosted in freedekstop.org in the nouveau/ git so we don't need additional accounts for everyone all around and people can keep pushing things (even better, all nouveau people can push to the drm, which used to require mesa rights before)
- we keep a(some) branch(es) in the tree for backwards compat with older kernels. Either in the form of separate kernel versions including nouveau, or in the form of an out-of-tree-compilable drm/nouveau module.

Quoted 1 line

So, does that plan sound sane? Do you have better plans?

I had a discussion with darktama (Ben) about this. Dave, there are questions specifically for you. Marcheu, we need your verdict after Dave's comments.

Using a kernel tree would free Ben and others from backporting things to drm.git. My "Building rawhide+darktama on 2.6.24" experiment shows, that it is possible to reach practically the same level of ease as drm.git offers to users. More on this later. One major point here is to keep the Nouveau DRM development in one place.

The downside is that BSD devels will probably get hurt. The backporting work Ben and others are doing now will fall onto them. Yet we cannot really stick to drm.git if we want upstream, since de facto upstream is Linux. Someone has to do the porting and it's pretty much a trade-off between helping BSDs or concentrating on core development.

Why have a full kernel tree, and not just drivers/gpu/? Because then it is easy to merge from upstream back to our tree.

My proposition follows:

Step 1: Nouveau development tree

This will be a complete kernel tree hosted at freedesktop.org. Ben is ready to request it from fd.o. This tree will be free for all developers to commit, adhering to kernel coding style. This is NOT a tree that will be sent upstream, but all (future) patches must be as upstream-quality as possible. This tree will completely replace drm.git's shared-core and linux-core directories.

This tree is never rebased. Ever. Period. Upstream kernel development will be marged back here, but we do not rebase. Whatever gets pushed into the repo, stays there. This offers a solid ground for devels to base their private work on. Somewhat related, read also this:
http://sourceforge.net/mailarchive/message.php?msg_name=alpine.LFD.2.00.0903291409030.3994%40localhost.localdomain

The $1M question: which kernel tree will this be based on? Ben tells me Dave's drm-next[1] gets rebased sometimes.

Dave, what are your plans on drm-next now after Linus' comments? Are you able to offer a DRM kernel tree that will not be rebased, and that we could use as the base?

Since this is not an upstreaming tree, it should not matter too much when we pull updates from upstream, but we probably need a policy for it.

Compatibility for older kernels can be implemented as a branch in this tree, let's call it compat. Compat starts as a fork of master, gets the basic compatibility patches from me, and then we periodically just merge master into compat to keep it up-to-date. If compatibility needs some fixes, they are just committed into the branch. This keeps the main development and backwards compat separate. I can maintain the compat stuff for now, and I will also have personal interest as long as I use 2.6.24. The single compat branch will serve "all" old kernels using #ifdefs. The compat branch is used with out-of-tree compiling.

There are several ways to offer the branches to users:
- cgit.fd.o can produce tar-balls of the complete tree, i.e. snapshots
- someone could set up an automatic snapshot service, that packages only the drivers/gpu/ directory and other relevant files instead of the full kernel tree
- users can clone the kernel tree without history, and still later use git-fetch or git-pull to stay up-to-date. (See git-clone --depth)

It is possible to build drm.ko and nouveau.ko out-of-tree. This means the modules are built from the Nouveau kernel tree sources, but for (with) whatever kernel the user is already running (provided the configuration supports Nouveau, and we have compat stuff for the kernel version). The commands are a bit long,
but we can offer a script that nicely automates it, and also checks the kernel config. I think we can get pretty close to how easy drm.git is for building kernel modules. Currently there is one nasty obstacle: some older kernels are missing EXPORT_SYMBOL_GPL(shmem_file_setup), which means the user needs to patch that in. Ben says we should be able to work around that in near future.

Step 2: Nouveau upstreaming tree

Because the development tree is a development tree, and from the kernel's perspective is a private tree, it will not be used for upstreaming. As you know, accidents happen in development trees, and the patches do not get reviewed before being pushed. A separate tree is made for upstreaming.

This tree will live in kernel.org and have a dedicated maintainer, who will cherry-pick patches from the Nouveau development tree for upstreaming. The upstreaming tree is based on whatever Dave wants, as the patches (or maybe pull-requests, when the practices have stabilized) will be sent to Dave.

There is no need to create the upstreaming tree until Nouveau is in the shape that it could start pushing for upstream. Hopefully by then we have also found the maintainer (or two). Personally I cannot promise to take this task, since I am not convinced I have the time to do it well.

In the meanwhile, we should rehearse making upstream-quality patches in the development tree.

Marcheu, what do you think about this? Let's give Ben the green light? Dave, do you think the git use policy I described is feasible?

Comments, objections?
I have read the earlier comments on this thread and hope to have answered all concerns.

A hint for kernel git trees: gitk -n 1000

Thanks.

[1] http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=summary

Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/