From nobody@FreeBSD.org  Thu Feb 24 21:15:43 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48CF21065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Feb 2011 21:15:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B7528FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Feb 2011 21:15:43 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1OLFgCZ097693
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Feb 2011 21:15:42 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p1OLFgRp097692;
	Thu, 24 Feb 2011 21:15:42 GMT
	(envelope-from nobody)
Message-Id: <201102242115.p1OLFgRp097692@red.freebsd.org>
Date: Thu, 24 Feb 2011 21:15:42 GMT
From: Tom Russo <tom.km5vy@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: nvidia-settings versions 195 and above fail to allow display configuration with legacy nvidia-driver versions
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         155011
>Category:       ports
>Synopsis:       x11/nvidia-settings versions 195 and above fail to allow display configuration with legacy nvidia-driver versions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bland
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 24 21:20:08 UTC 2011
>Closed-Date:    Tue Aug 21 14:50:14 UTC 2012
>Last-Modified:  Tue Aug 21 15:00:22 UTC 2012
>Originator:     Tom Russo
>Release:        7.4-PRERELEASE
>Organization:
>Environment:
FreeBSD bogodyn.org 7.4-PRERELEASE FreeBSD 7.4-PRERELEASE #0: Sat Jan  1 21:48:22 MST 2011     russo@bogodyn.org:/users2/obj/usr/src/sys/BOGODYN  i386

>Description:
Beginning with nvidia-settings 195 and ever since, the "X Server Display Configuration" panel has produced an error "Failed to query NoScanout for screen 0" and refused to allow display configuration if a "legacy" version of the driver is installed (e.g. nvidia-driver-71, nvidia-driver-95 or nvidia-driver-173).  That is because the "NoScanout" property was added in nvidia-driver 195, and the settings program treats not finding it as an error, guaranteeing that the latest nvidia-settings will be broken when used on a machine with legacy drivers.

Unless the nvidia-settings port is tweaked to install versions of nvidia-settings matching the installed driver, nvidia-settings needs to be patched in order to prevent this breakage.

>How-To-Repeat:
Install an older NVIDIA video card requiring a legacy NVIDIA driver and install the appropriate legacy driver.  Install the latest nvidia-settings port (which at this time is version 270.18).  Run nvidia-settings and click "X Server Display Configuration."  You will get a screen that shows "Unable to load X Server Display Configuration Page:  Failed to query NoScanout for screen 0."  There is at that point no way to manipulate display configuration through the GUI.
>Fix:
The attached patch comments out the code that treats a missing NoScanout property as an error, and returns instead a response to indicate NoScanout is disabled.

This patch is copied from Ubuntu's bug tracker, where it is part of the nvidia-settings package build process.

http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/lucid/nvidia-settings/lucid/revision/27

This patch allows nvidia-settings' X Server Display Configuration panel to work properly with legacy nvidia-driver ports.

The only difference between the attached patch and Ubuntu's is that I have used  "#if 0/#endif" preprocessor directives to disable the code rather than C comments.

Patch attached with submission follows:

--- src/gtk+-2.x/ctkdisplayconfig-utils.c.orig	2011-02-24 13:55:03.000000000 -0700
+++ src/gtk+-2.x/ctkdisplayconfig-utils.c	2011-02-24 13:56:05.000000000 -0700
@@ -2103,11 +2103,14 @@
     /* See if the screen is set to not scanout */
     ret = NvCtrlGetAttribute(screen->handle, NV_CTRL_NO_SCANOUT, &val);
     if (ret != NvCtrlSuccess) {
+#if 0
         *err_str = g_strdup_printf("Failed to query NoScanout for "
                                    "screen %d.",
                                    screen_id);
         nv_warning_msg(*err_str);
         goto fail;
+#endif
+        val = NV_CTRL_NO_SCANOUT_DISABLED;
     }
     screen->no_scanout = (val == NV_CTRL_NO_SCANOUT_ENABLED);
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->bland 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 25 08:02:13 UTC 2011 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155011 
State-Changed-From-To: open->closed 
State-Changed-By: bland 
State-Changed-When: Tue Aug 21 14:49:48 UTC 2012 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=155011 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/155011: commit references a PR
Date: Tue, 21 Aug 2012 14:49:50 +0000 (UTC)

 Author: bland
 Date: Tue Aug 21 14:49:33 2012
 New Revision: 302865
 URL: http://svn.freebsd.org/changeset/ports/302865
 
 Log:
   Allow display configuration with legacy nvidia-driver versions.
   
   PR:	155011
 
 Modified:
   head/x11/nvidia-settings/Makefile
   head/x11/nvidia-settings/files/patch-src__gtk+-2.x__ctkdisplayconfig-utils.c
 
 Modified: head/x11/nvidia-settings/Makefile
 ==============================================================================
 --- head/x11/nvidia-settings/Makefile	Tue Aug 21 14:35:14 2012	(r302864)
 +++ head/x11/nvidia-settings/Makefile	Tue Aug 21 14:49:33 2012	(r302865)
 @@ -7,6 +7,7 @@
  
  PORTNAME=	nvidia-settings
  PORTVERSION=	295.71
 +PORTREVISION=	1
  CATEGORIES=	x11
  MASTER_SITES=	ftp://download.nvidia.com/XFree86/nvidia-settings/ \
  		ftp://download1.nvidia.com/XFree86/nvidia-settings/
 
 Modified: head/x11/nvidia-settings/files/patch-src__gtk+-2.x__ctkdisplayconfig-utils.c
 ==============================================================================
 --- head/x11/nvidia-settings/files/patch-src__gtk+-2.x__ctkdisplayconfig-utils.c	Tue Aug 21 14:35:14 2012	(r302864)
 +++ head/x11/nvidia-settings/files/patch-src__gtk+-2.x__ctkdisplayconfig-utils.c	Tue Aug 21 14:49:33 2012	(r302865)
 @@ -9,3 +9,20 @@
           }
   
   
 +--- src/gtk+-2.x/ctkdisplayconfig-utils.c.orig	2012-08-21 23:36:11.000000000 +0900
 ++++ src/gtk+-2.x/ctkdisplayconfig-utils.c	2012-08-21 23:36:46.000000000 +0900
 +@@ -2534,11 +2534,14 @@
 +     /* See if the screen is set to not scanout */
 +     ret = NvCtrlGetAttribute(screen->handle, NV_CTRL_NO_SCANOUT, &val);
 +     if (ret != NvCtrlSuccess) {
 ++#if 0
 +         *err_str = g_strdup_printf("Failed to query NoScanout for "
 +                                    "screen %d.",
 +                                    screen_id);
 +         nv_warning_msg(*err_str);
 +         goto fail;
 ++#endif
 ++        val = NV_CTRL_NO_SCANOUT_DISABLED;
 +     }
 +     screen->no_scanout = (val == NV_CTRL_NO_SCANOUT_ENABLED);
 + 
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
