Re: [PATCH] linux: Fix error message when /dev/tty0 fails to open

2012-01-14 Thread Cyril Brulebois
Chad Versace chad.vers...@linux.intel.com (13/01/2012):
 When attempting to open the console device during initialization, X first
 tries to open /dev/tty0 in write-only mode, and if that fails it attempts
 to open /dev/vc/0. If both attempts fail, the error message below is
 logged. The message is incorrect because the errno is that resulting from
 the failure to open /dev/vc/0.
 
 xf86OpenConsole: Cannot open /dev/tty0 ({strerror(errno)})
 
 On a machine in which /dev/tty0 does exist but /dev/vc/0 does not, such as
 my machine, the log misleadingly says:
 
 Fatal server error:
 [  3167.976] xf86OpenConsole: Cannot open /dev/tty0 (No such file or 
 directory)
 
 This patch fixes the log to report the correct errno for each device. The
 result is this log snippet:
 
 [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/tty0 for writing 
 (Permission denied)
 [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/vc/0 for writing 
 (No such file or directory)
 [  3755.177]
 Fatal server error:
 [  3755.177] xf86OpenConsole: Failed to open console device

Looks like a nice improvement.

Acked-by: Cyril Brulebois k...@debian.org

Mraw,
KiBi.


signature.asc
Description: Digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH sis] Untangle XF86DRI from the driver-specific DRI define

2012-01-14 Thread Tormod Volden
On Wed, Jan 4, 2012 at 5:14 AM, Peter Hutterer peter.hutte...@who-t.net wrote:
 XF86DRI is defined by xorg-server.h, so --disable-dri in the sis driver
 itself does exactly nothing other than not fill in the CFLAGS and thus stop
 the driver from compiling.

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  configure.ac     |    4 ++--
  src/sis.h        |   16 +++-
  src/sis_dri.c    |    2 +-
  src/sis_driver.c |   14 +++---
  src/sis_opt.c    |    4 ++--
  5 files changed, 23 insertions(+), 17 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index 036a448..a599108 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -99,8 +99,8 @@ AC_MSG_RESULT([$DRI])
  AM_CONDITIONAL(DRI, test x$DRI = xyes)
  if test $DRI = yes; then
         PKG_CHECK_MODULES(DRI, [libdrm = 2.0 xf86driproto])
 -        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
 -        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
 +        AC_DEFINE(SISDRI,1,[Enable DRI driver support])
 +        AC_DEFINE(SIDDRI_DEVEL,1,[Enable developmental DRI driver support])

s/SIDDRI_DEVEL/SISDRI_DEVEL I suppose.

  fi

  # technically this should be a configure flag.  meh.
 diff --git a/src/sis.h b/src/sis.h
 index 9af31a5..f2ca3a9 100644
 --- a/src/sis.h
 +++ b/src/sis.h
 @@ -181,7 +181,13 @@

  #undef SISHAVEDRMWRITE
  #undef SISNEWDRI
 -#ifdef XF86DRI
 +
 +/* if the server was built without DRI support, force-disable DRI */
 +#ifndef XF86DRI
 +#undef SISDRI
 +#endif
 +
 +#ifdef SISDRI
  #if XF86_VERSION_CURRENT = XF86_VERSION_NUMERIC(4,2,99,3,0)
  #define SISHAVEDRMWRITE
  #endif
 @@ -195,7 +201,7 @@
  #include dri.h
  #include GL/glxint.h
  #include sis_dri.h
 -#endif /* XF86DRI */
 +#endif /* SISDRI */

  /* Configurable stuff: - */

 @@ -812,7 +818,7 @@ typedef struct {
     ScrnInfoPtr                pScrn_2;
     UChar              *BIOS;
     struct SiS_Private *SiS_Pr;
 -#ifdef XF86DRI
 +#ifdef SISDRI
     SISAGPHTYPE                agpHandle;
     ULong              agpAddr;
     UChar              *agpBase;
 @@ -1092,7 +1098,7 @@ typedef struct {
     unsigned int       cmdQueueSize_div2;
     unsigned int       cmdQueueSize_div4;
     unsigned int       cmdQueueSize_4_3;
 -#ifdef XF86DRI
 +#ifdef SISDRI
     SISAGPHTYPE                agpHandle;
     ULong              agpAddr;
     UChar              *agpBase;
 @@ -1151,7 +1157,7 @@ typedef struct {

     /* DRI */
     Bool               loadDRI;
 -#ifdef XF86DRI
 +#ifdef SISDRI
     Bool               directRenderingEnabled;
     DRIInfoPtr                 pDRIInfo;
     int                        drmSubFD;
 diff --git a/src/sis_dri.c b/src/sis_dri.c
 index 97ed951..d0c4fba 100644
 --- a/src/sis_dri.c
 +++ b/src/sis_dri.c
 @@ -369,7 +369,7 @@ SISDRIScreenInit(ScreenPtr pScreen)
    */
   pDRIInfo-SAREASize =
     ((sizeof(XF86DRISAREARec) + getpagesize() - 1)  getpagesize()); /* round 
 to page */
 -    /* ((sizeof(XF86DRISAREARec) + 0xfff)  0x1000); */ /* round to page */
 +    /* ((sizeof(SISDRISAREARec) + 0xfff)  0x1000); */ /* round to page */

This looks like an accidental find-and-replace.

   /* + shared memory device private rec */
  #else
   /* For now the mapping works by using a fixed size defined
 diff --git a/src/sis_driver.c b/src/sis_driver.c
 index 3218239..d733f48 100644
 --- a/src/sis_driver.c
 +++ b/src/sis_driver.c
 @@ -90,7 +90,7 @@
  #endif


 -#ifdef XF86DRI
 +#ifdef SISDRI
  #include dri.h
  #endif

 @@ -6895,7 +6895,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
     }

     /* Load the dri and glx modules if requested. */
 -#ifdef XF86DRI
 +#ifdef SISDRI
     if(pSiS-loadDRI) {
        if(!xf86LoaderCheckSymbol(DRIScreenInit)) {
          if(xf86LoadSubModule(pScrn, dri)) {
 @@ -8731,7 +8731,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int 
 argc, char **argv)

     pSiS-cmdQueueLen = 0; /* Force an EngineIdle() at start */

 -#ifdef XF86DRI
 +#ifdef SISDRI
     if(pSiS-loadDRI) {
  #ifdef SISDUALHEAD
        /* No DRI in dual head mode */
 @@ -9044,7 +9044,7 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int 
 argc, char **argv)
     }
  #endif

 -#ifdef XF86DRI
 +#ifdef SISDRI
     if(pSiS-loadDRI) {
        if(pSiS-directRenderingEnabled) {
           /* Now that mi, drm and others have done their thing,
 @@ -9778,7 +9778,7 @@ SISEnterVT(int scrnIndex, int flags)

     SISAdjustFrame(scrnIndex, pScrn-frameX0, pScrn-frameY0, 0);

 -#ifdef XF86DRI
 +#ifdef SISDRI
     if(pSiS-directRenderingEnabled) {
        DRIUnlock(screenInfo.screens[scrnIndex]);
     }
 @@ -9804,7 +9804,7 @@ SISLeaveVT(int scrnIndex, int flags)
  {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     SISPtr pSiS = SISPTR(pScrn);
 -#ifdef XF86DRI
 +#ifdef SISDRI
     ScreenPtr pScreen;

     if(pSiS-directRenderingEnabled) {
 @@ -9888,7 +9888,7 @@ SISCloseScreen(int scrnIndex, ScreenPtr pScreen)
        SiSCtrlExtUnregister(pSiS, pScrn-scrnIndex);
     }

 -#ifdef XF86DRI
 +#ifdef 

Re: [PATCH] linux: Fix error message when /dev/tty0 fails to open

2012-01-14 Thread Julien Cristau
On Fri, Jan 13, 2012 at 16:12:25 -0800, Chad Versace wrote:

 When attempting to open the console device during initialization, X first
 tries to open /dev/tty0 in write-only mode, and if that fails it attempts
 to open /dev/vc/0. If both attempts fail, the error message below is
 logged. The message is incorrect because the errno is that resulting from
 the failure to open /dev/vc/0.
 
 xf86OpenConsole: Cannot open /dev/tty0 ({strerror(errno)})
 
 On a machine in which /dev/tty0 does exist but /dev/vc/0 does not, such as
 my machine, the log misleadingly says:
 
 Fatal server error:
 [  3167.976] xf86OpenConsole: Cannot open /dev/tty0 (No such file or 
 directory)
 
 This patch fixes the log to report the correct errno for each device. The
 result is this log snippet:
 
 [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/tty0 for writing 
 (Permission denied)
 [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/vc/0 for writing 
 (No such file or directory)
 [  3755.177]
 Fatal server error:
 [  3755.177] xf86OpenConsole: Failed to open console device
 
Maybe we should just drop the /dev/vc/0 stuff?  Surely nobody uses devfs
anymore?

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel