Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Dec 2014 11:44:01 -0500
From:      "Mikhail T." <mi+thun@aldan.algebra.com>
To:        x11@FreeBSD.org
Subject:   "SOLVED": Painfully slow X11 after upgrade
Message-ID:  <548B1B51.8040705@aldan.algebra.com>
In-Reply-To: <20141120072234.6de67301@X220.alogt.com>
References:  <546CBE3A.20502@aldan.algebra.com> <20141120072234.6de67301@X220.alogt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050709030507080909020503
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit

This is, what I ended up doing:

 1. Switch from xf86-video-ati to xf86-video-ati-ums
 2. The xf86-video-ati-ums didn't look quite right, so I added the below
    patches to:
     1. (optionally) disable attempts by the driver to limit video-modes
        based "bandwidth" considerations -- I was now able to get the
        1600x1200 screen, which is the native mode of my LCD monitor --
        glxgears (default size) ran at about 100 frames per second
        (compared with 50 fps of unmodified KMS);
     2. disable attempts by the driver to disable DRI based on card's
        memory considerations -- the current formula it uses made no
        sense to me so I changed the code to issue a warning, but
        proceed with DRI anyway -- I now get DRI and the same glxgears
        manages 250 fps.
 3. Patch our xf86-video-ati-ums/Makefile to take advantage of the
    option 2.a. above.

My card is not capable of (hardware) OpenGL -- but it can do direct
rendering...

Maybe, something similar can be done with the KMS radeon driver?

    -mi


--------------050709030507080909020503
Content-Type: text/plain; charset=KOI8-U;
 name="patch-src__radeon_driver.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="patch-src__radeon_driver.c"

--- src/radeon_driver.c	2012-06-25 04:19:41.000000000 -0400
+++ src/radeon_driver.c	2014-12-12 10:30:55.000000000 -0500
@@ -3665,14 +3665,15 @@
 	if (maxy <= pScrn->virtualY * 3) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "Static buffer allocation failed.  Disabling DRI.\n");
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "At least %d kB of video memory needed at this "
-		       "resolution and depth.\n",
+		       "resolution (%dx%d) and depth (%d*3). We only have "
+		       "%d/%d (%d)? Will try anyway, disable DRI by hand if "
+		       "you'd rather we didn't\n",
 		       (pScrn->displayWidth * pScrn->virtualY *
-			info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024);
-	    info->directRenderingEnabled = FALSE;
-	} else {
-	    info->directRenderingEnabled = RADEONDRIScreenInit(pScreen);
+			info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024,
+		       pScrn->displayWidth, pScrn->virtualY,
+		       info->CurrentLayout.pixel_bytes, info->FbMapSize/1024,
+		       width_bytes, maxy/1024);
 	}
+	info->directRenderingEnabled = RADEONDRIScreenInit(pScreen);
     }
 
@@ -6056,4 +6057,5 @@
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
 
+#ifndef DISABLE_MODE_BANDWIDTH
     /*
      * RN50 has effective maximum mode bandwidth of about 300MiB/s.
@@ -6065,4 +6067,5 @@
 	    return MODE_BANDWIDTH;
     }
+#endif
 
     /* There are problems with double scan mode at high clocks

--------------050709030507080909020503
Content-Type: text/plain; charset=KOI8-U;
 name="patch-src__radeon_output.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="patch-src__radeon_output.c"

--- src/radeon_output.c	2012-06-25 04:19:41.000000000 -0400
+++ src/radeon_output.c	2014-12-12 10:18:36.000000000 -0500
@@ -534,4 +534,5 @@
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
 
+#ifndef DISABLE_MODE_BANDWIDTH
     /*
      * RN50 has effective maximum mode bandwidth of about 300MiB/s.
@@ -543,4 +544,5 @@
 	    return MODE_BANDWIDTH;
     }
+#endif
 
     if (radeon_output->active_device & (ATOM_DEVICE_TV_SUPPORT)) {

--------------050709030507080909020503
Content-Type: text/plain; charset=KOI8-U;
 name="xf86-video-ati-ums.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="xf86-video-ati-ums.patch"

Index: Makefile
===================================================================
--- Makefile	(revision 374568)
+++ Makefile	(working copy)
@@ -13,6 +13,10 @@
 XORG_CAT=	driver
 USE_XORG=	xf86driproto xineramaproto xf86miscproto glproto
 
+OPTIONS_DEFINE=	BANDWIDTH
+BANDWIDTH_DESC= Ignore card's presumed bandwidth, when selecting video mode
+BANDWIDTH_CFLAGS=-DDISABLE_MODE_BANDWIDTH
+
 CONFIGURE_ARGS+=--disable-kms
 INSTALL_TARGET=	install-strip
 

--------------050709030507080909020503--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?548B1B51.8040705>