diff mbox

Make DGA optional

Message ID 20090916073330.GA11635@zhen-devel.sh.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Zhenyu Wang Sept. 16, 2009, 7:33 a.m. UTC
On 2009.09.15 08:11:41 -0700, Keith Packard wrote:
> On Tue, 2009-09-15 at 15:14 +0800, Zhenyu Wang wrote:
> 
> > As DGA is optional in xserver, revert that one might crash X in start.
> > Or we just fake to init DGA proto, not sure if there's any DGA callbacks
> > that driver can use for framebuffer open later?
> 
> DGA isn't really optional; you'd have to recompile the X server to
> disable it. And, as we know, many applications depend on it (but only
> for input).
> 

Keith, are you ok with this one?

From 0449c374fd114d392412793e57cfdd8cefb7a504 Mon Sep 17 00:00:00 2001
From: Zhenyu Wang <zhenyuw@linux.intel.com>
Date: Wed, 16 Sep 2009 15:28:22 +0800
Subject: [PATCH] Always enable DGA

Partially revert fe7693c94a396b9d17bb66a000178750a432ce3a, which
did DGA disable in KMS case, which causes problem for games require
DGA for mouse tracking. So in KMS, we'll pass '-1' address for DGA
which is fine as nobody should use DGA for rendering now. oh, well.

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
 src/i830_driver.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Keith Packard Sept. 16, 2009, 10:37 p.m. UTC | #1
On Wed, 2009-09-16 at 15:33 +0800, Zhenyu Wang wrote:

> Keith, are you ok with this one?

Sadly, we can't actually fix this in the driver -- anything we return
will get passed back to the application which will then happily mmap
that and start drawing on it. Worse yet, the application need not even
have root access as the server will create a pixmap pointing at that
memory and paint all over it in response to client rendering requests.

I've posted a patch to the X server which removes all of the rendering
capability from the DGA extension. That can be applied on the 1.6 branch
as well.

-keith
Zhenyu Wang Sept. 17, 2009, 1:02 a.m. UTC | #2
On 2009.09.16 15:37:52 -0700, Keith Packard wrote:
> On Wed, 2009-09-16 at 15:33 +0800, Zhenyu Wang wrote:
> 
> > Keith, are you ok with this one?
> 
> Sadly, we can't actually fix this in the driver -- anything we return
> will get passed back to the application which will then happily mmap
> that and start drawing on it. Worse yet, the application need not even
> have root access as the server will create a pixmap pointing at that
> memory and paint all over it in response to client rendering requests.

yeah, that's the thing I don't know how we can fix it.

> 
> I've posted a patch to the X server which removes all of the rendering
> capability from the DGA extension. That can be applied on the 1.6 branch
> as well.
> 

Nice! I'll hold mine until xserver got patched.

Thanks.
diff mbox

Patch

diff --git a/src/i830_driver.c b/src/i830_driver.c
index e3e1ed2..5585df0 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2739,8 +2739,7 @@  I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    xf86SetBlackWhitePixels(pScreen);
 
 #ifdef XFreeXDGA
-   if (!pI830->use_drm_mode)
-       xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
+   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
 #endif
 
    if (!I830AccelInit(pScreen)) {