Re: [RFC PATCH] Only open the console if the video driver needs hardware access.

2009-10-02 Thread Eric Anholt
On Thu, 2009-10-01 at 20:58 +0200, Mark Kettenis wrote:
  Date: Thu, 1 Oct 2009 11:50:42 -0700
  From: Jamey Sharp ja...@minilop.net
  
  xf86OpenConsole fails as non-root, at least on Linux. Since the
  xf86-video-dummy driver works fine without root privileges or console
  access, just don't open the console.
  ---
  I wanted to see how to replace Xvfb and Xfake with an appropriate video
  driver for the xfree86 DDX, and needing root privileges was obnoxious.
  Aside from that problem, the existing dummy driver seems well on the way
  to doing the job.
  
  But I'm guessing this is the wrong way to solve this problem.
 
 I suspect so.  I think for example the wsfb driver on OpenBSD doesn't
 need hardware access in the xorgHWAccess sense, but still needs
 console access.

This seems related to jbarnes's non-root X stuff

http://lists.x.org/archives/xorg-devel/2009-July/001293.html

Perhaps we need a flag for this ddx needs console access as well as
this ddx needs io ports and such

-- 
Eric Anholt
e...@anholt.net eric.anh...@intel.com




signature.asc
Description: This is a digitally signed message part
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


Re: [RFC PATCH] Only open the console if the video driver needs hardware access.

2009-10-02 Thread Jesse Barnes
On Thu, 01 Oct 2009 14:21:22 -0700
Eric Anholt e...@anholt.net wrote:

 On Thu, 2009-10-01 at 20:58 +0200, Mark Kettenis wrote:
   Date: Thu, 1 Oct 2009 11:50:42 -0700
   From: Jamey Sharp ja...@minilop.net
   
   xf86OpenConsole fails as non-root, at least on Linux. Since the
   xf86-video-dummy driver works fine without root privileges or
   console access, just don't open the console.
   ---
   I wanted to see how to replace Xvfb and Xfake with an appropriate
   video driver for the xfree86 DDX, and needing root privileges was
   obnoxious. Aside from that problem, the existing dummy driver
   seems well on the way to doing the job.
   
   But I'm guessing this is the wrong way to solve this problem.
  
  I suspect so.  I think for example the wsfb driver on OpenBSD
  doesn't need hardware access in the xorgHWAccess sense, but still
  needs console access.
 
 This seems related to jbarnes's non-root X stuff
 
 http://lists.x.org/archives/xorg-devel/2009-July/001293.html
 
 Perhaps we need a flag for this ddx needs console access as well as
 this ddx needs io ports and such

Yeah, that would be an easy enough flag to add to the get hardware
interfaces function if needed.  Another option would be to mess with
the distro console ownership scripts to avoid any permission problems.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel


[RFC PATCH] Only open the console if the video driver needs hardware access.

2009-10-01 Thread Jamey Sharp
xf86OpenConsole fails as non-root, at least on Linux. Since the
xf86-video-dummy driver works fine without root privileges or console
access, just don't open the console.
---
I wanted to see how to replace Xvfb and Xfake with an appropriate video
driver for the xfree86 DDX, and needing root privileges was obnoxious.
Aside from that problem, the existing dummy driver seems well on the way
to doing the job.

But I'm guessing this is the wrong way to solve this problem.
Suggestions?

 hw/xfree86/common/xf86Init.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index c9baff3..dc8fb53 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -601,8 +601,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 if (xf86DoShowOptions)
 DoShowOptions();
 
-xf86OpenConsole();
-
 /* Do a general bus probe.  This will be a PCI probe for x86 platforms */
 xf86BusProbe();
 
@@ -692,7 +690,11 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 
 /* Enable full I/O access */
 if (xorgHWAccess)
+{
xorgHWAccess = xf86EnableIO();
+   xf86OpenConsole();
+}
+
 
 /*
  * Locate bus slot that had register IO enabled at server startup
@@ -966,7 +968,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 /*
  * serverGeneration != 1; some OSs have to do things here, too.
  */
-xf86OpenConsole();
+if (xorgHWAccess)
+   xf86OpenConsole();
 
 #ifdef XF86PM
 /*
@@ -1203,7 +1206,8 @@ ddxGiveUp(void)
 DGAShutdown();
 #endif
 
-xf86CloseConsole();
+if (xorgHWAccess)
+   xf86CloseConsole();
 
 xf86CloseLog();
 
-- 
1.6.3.3

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel