rpms/xorg-x11-drv-ati/F-11 radeon-modeset-zaphod.patch, NONE, 1.1 xorg-x11-drv-ati.spec, 1.176, 1.177

Dave Airlie airlied at fedoraproject.org
Wed Apr 15 11:36:16 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/xorg-x11-drv-ati/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8116

Modified Files:
	xorg-x11-drv-ati.spec 
Added Files:
	radeon-modeset-zaphod.patch 
Log Message:
* Wed Apr 15 2009 Dave Airlie <airlied at redhat.com> 6.12.2-3
- radeon-modeset-zaphod.patch: fix zaphod under kms in theory


radeon-modeset-zaphod.patch:

--- NEW FILE radeon-modeset-zaphod.patch ---
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2e68744..a0527c0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -188,6 +188,8 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	}
 			
 	src = create_pixmap_for_fbcon(drmmode, pScrn, crtc_id);
+	if (!src)
+		return;
 
 	dst = GetScratchPixmapHeader(pScreen,
 				     pScrn->virtualX, pScrn->virtualY,
@@ -450,6 +452,13 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat
 
 }
 
+static void
+drmmode_crtc_gamma_set(xf86CrtcPtr crtc, uint16_t *red, uint16_t *green,
+                      uint16_t *blue, int size)
+{
+	return;
+}
+
 static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
     .dpms = drmmode_crtc_dpms,
     .set_mode_major = drmmode_set_mode_major,
@@ -459,12 +468,10 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
     .hide_cursor = drmmode_hide_cursor,
     .load_cursor_argb = drmmode_load_cursor_argb,
 
+    .gamma_set = drmmode_crtc_gamma_set,
     .shadow_create = drmmode_crtc_shadow_create,
     .shadow_allocate = drmmode_crtc_shadow_allocate,
     .shadow_destroy = drmmode_crtc_shadow_destroy,
-#if 0
-    .gamma_set = i830_crtc_gamma_set,
-#endif
     .destroy = NULL, /* XXX */
 };
 
@@ -804,24 +811,31 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
 };
 
 
-Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId, char *driver_name, int cpp)
+Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId, char *driver_name, int cpp, int zaphod_mask)
 {
 	xf86CrtcConfigPtr   xf86_config;
+    	RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
 	int i;
 	Bool ret;
 
 	/* Create a bus Id */
 	/* Low level DRM open */
-	ret = DRIOpenDRMMaster(pScrn, SAREA_MAX, busId, driver_name);
-	if (!ret) {
+	if (!pRADEONEnt->fd) {
+		ret = DRIOpenDRMMaster(pScrn, SAREA_MAX, busId, driver_name);
+		if (!ret) {
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+				   "[dri] DRIGetVersion failed to open the DRM\n"
+				   "[dri] Disabling DRI.\n");
+			return FALSE;
+		}
+
+		drmmode->fd = DRIMasterFD(pScrn);
+		pRADEONEnt->fd = drmmode->fd;
+	} else {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "[dri] DRIGetVersion failed to open the DRM\n"
-			   "[dri] Disabling DRI.\n");
-		return FALSE;
+				" reusing fd for second head\n");
+		drmmode->fd = pRADEONEnt->fd;
 	}
-
-	drmmode->fd = DRIMasterFD(pScrn);
-
 	xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
 	xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
 
@@ -832,10 +846,12 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId, char
 
 	xf86CrtcSetSizeRange(pScrn, 320, 200, drmmode->mode_res->max_width, drmmode->mode_res->max_height);
 	for (i = 0; i < drmmode->mode_res->count_crtcs; i++)
-		drmmode_crtc_init(pScrn, drmmode, i);
+		if (zaphod_mask & (1 << i))
+			drmmode_crtc_init(pScrn, drmmode, i);
 
 	for (i = 0; i < drmmode->mode_res->count_connectors; i++)
-		drmmode_output_init(pScrn, drmmode, i);
+		if (zaphod_mask & (1 << i))
+			drmmode_output_init(pScrn, drmmode, i);
 
 	xf86InitialConfiguration(pScrn, TRUE);
 
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index cb72f9f..337288a 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -62,7 +62,7 @@ typedef struct {
 } drmmode_output_private_rec, *drmmode_output_private_ptr;
 
 
-extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId, char *driver_name, int cpp);
+extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, char *busId, char *driver_name, int cpp, int zaphod_mask);
 extern Bool drmmode_set_bufmgr(ScrnInfoPtr pScrn, drmmode_ptr drmmode, dri_bufmgr *bufmgr);
 extern void drmmode_set_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int width, int height, int pitch, dri_bo *bo);
 extern void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, dri_bo *bo);
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 41ead39..5bd192b 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3145,11 +3145,18 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
     } else {
 #ifdef XF86DRM_MODE
 	char *bus_id;
-   	 if (!radeon_alloc_dri(pScrn))
+	int zaphod_mask;
+	if (!radeon_alloc_dri(pScrn))
 		return FALSE;
 
+	zaphod_mask = 0xf;
+	if (info->IsPrimary)
+		zaphod_mask = 0xd;
+	if (info->IsSecondary)
+		zaphod_mask = 0x2;
+
 	bus_id = DRICreatePCIBusID(info->PciInfo);
-	if (drmmode_pre_init(pScrn, &info->drmmode, bus_id, "radeon", pScrn->bitsPerPixel / 8) == FALSE) {
+	if (drmmode_pre_init(pScrn, &info->drmmode, bus_id, "radeon", pScrn->bitsPerPixel / 8, zaphod_mask) == FALSE) {
 	    xfree(bus_id);
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n");
 	    goto fail;
diff --git a/src/radeon_memory.c b/src/radeon_memory.c
index 2f2b2fd..cded7e7 100644
--- a/src/radeon_memory.c
+++ b/src/radeon_memory.c
@@ -19,14 +19,9 @@ Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
     int screen_size;
     int stride = pScrn->displayWidth * cpp;
     int total_size_bytes = 0, remain_size_bytes;
-    int fb_size_bytes;
     int pagesize = 4096;
     
     screen_size = RADEON_ALIGN(pScrn->virtualY, 16) * stride;
-
-    ErrorF("%d x %d x %d = %dK\n", pScrn->displayWidth, pScrn->virtualY, cpp, screen_size / 1024);
-
-
     {
 	int cursor_size = 64 * 4 * 64;
 	int c;
@@ -57,23 +52,6 @@ Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
     remain_size_bytes = info->mm.vram_size - total_size_bytes;
 
     info->dri->textureSize = 0;
-#if 0
-    if (info->dri->textureSize > 0)
-    	info->dri->textureSize = (remain_size_bytes / 100) * info->dri->textureSize;
-    else
-    	info->dri->textureSize = remain_size_bytes / 2;
-
-    info->dri->textureSize = RADEON_ALIGN(info->dri->textureSize, pagesize);
-
-    remain_size_bytes -= info->dri->textureSize;
-#endif
-
-    ErrorF("texture size is %dK, exa is %dK\n", info->dri->textureSize / 1024, remain_size_bytes/1024);
-
-
-    fb_size_bytes = screen_size;
-
-    ErrorF("fb size is %dK %dK\n", fb_size_bytes / 1024, total_size_bytes / 1024);
 
     info->mm.front_buffer = dri_bo_alloc(info->bufmgr, "front", screen_size,
 					 0, RADEON_GEM_DOMAIN_VRAM);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index e860388..badd361 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -611,6 +611,7 @@ typedef struct
     RADEONSaveRec     SavedReg;         /* Original (text) mode              */
 
     void              *MMIO;            /* Map of MMIO region                */
+    int fd;
 } RADEONEntRec, *RADEONEntPtr;
 
 /* radeon_probe.c */


Index: xorg-x11-drv-ati.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ati/F-11/xorg-x11-drv-ati.spec,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- xorg-x11-drv-ati.spec	15 Apr 2009 02:54:23 -0000	1.176
+++ xorg-x11-drv-ati.spec	15 Apr 2009 11:35:43 -0000	1.177
@@ -5,7 +5,7 @@
 Summary:   Xorg X11 ati video driver
 Name:      xorg-x11-drv-ati
 Version:   6.12.2
-Release:   2%{?dist}
+Release:   3%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -15,6 +15,7 @@
 Source1:   radeon.xinf
 
 Patch1:     radeon-modeset.patch
+Patch2:	    radeon-modeset-zaphod.patch
 Patch6:     radeon-6.9.0-bgnr-enable.patch
 Patch7:	    radeon-6.12.1-r600-fb-size.patch
 
@@ -39,6 +40,7 @@
 %prep
 %setup -q -n %{tarball}-%{version}
 %patch1 -p1 -b .modeset
+%patch2 -p1 -b .modeset-zaphod
 %patch6 -p1 -b .bgnr
 %patch7 -p1 -b .r600-fb-size
 
@@ -72,6 +74,9 @@
 %{_mandir}/man4/radeon.4*
 
 %changelog
+* Wed Apr 15 2009 Dave Airlie <airlied at redhat.com> 6.12.2-3
+- radeon-modeset-zaphod.patch: fix zaphod under kms in theory
+
 * Wed Apr 15 2009 Dave Airlie <airlied at redhat.com> 6.12.2-2
 - radeon-modeset.patch: fix rotation + cache mmap uninit var path
 




More information about the fedora-extras-commits mailing list