diff mbox

Make DGA optional

Message ID 1251903453-12710-1-git-send-email-zhenyuw@linux.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Zhenyu Wang Sept. 2, 2009, 2:57 p.m. UTC
As DGA is optional in xserver, we should check this too instead
of always trying to init DGA.

Found when update xserver to 6fffcd5825454a7fe58ffbcfb219f007cf38e731,
but not update xf86dgaproto, which caused X fails to start.

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

Comments

Carl Worth Sept. 2, 2009, 2:17 p.m. UTC | #1
Excerpts from Zhenyu Wang's message of Wed Sep 02 07:57:33 -0700 2009:
> As DGA is optional in xserver, we should check this too instead
> of always trying to init DGA.
> 
> Found when update xserver to 6fffcd5825454a7fe58ffbcfb219f007cf38e731,
> but not update xf86dgaproto, which caused X fails to start.

Thanks. I had just run into this problem myself, but didn't find the
complete solution.

This is pushed now.

-Carl
Zhenyu Wang Sept. 15, 2009, 2:26 a.m. UTC | #2
On 2009.09.02 22:57:33 +0800, Zhenyu Wang wrote:
> As DGA is optional in xserver, we should check this too instead
> of always trying to init DGA.
> 
> Found when update xserver to 6fffcd5825454a7fe58ffbcfb219f007cf38e731,
> but not update xf86dgaproto, which caused X fails to start.
> 
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> ---
>  src/i810_driver.c |    2 ++
>  src/i830_driver.c |    5 ++++-
>  2 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/src/i810_driver.c b/src/i810_driver.c
> index a08a500..7961c3d 100644
> --- a/src/i810_driver.c
> +++ b/src/i810_driver.c
> @@ -2024,7 +2024,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
>     }
>  #endif
>  
> +#ifdef XFreeXDGA
>     I810DGAInit(pScreen);
> +#endif
>  
>     if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> diff --git a/src/i830_driver.c b/src/i830_driver.c
> index 7e0ebf3..4334de6 100644
> --- a/src/i830_driver.c
> +++ b/src/i830_driver.c
> @@ -2733,7 +2733,10 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
>  
>     xf86SetBlackWhitePixels(pScreen);
>  
> -   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
> +#ifdef XFreeXDGA
> +   if (!pI830->use_drm_mode)
> +       xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
> +#endif
>  
>     if (!I830AccelInit(pScreen)) {
>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> -- 
> 1.5.3.8

This one also disables DGA in KMS, which introduce http://bugs.freedesktop.org/show_bug.cgi?id=23858
Any idea on how to enable DGA in KMS?
Gordon Jin Sept. 15, 2009, 7:07 a.m. UTC | #3
Zhenyu Wang wrote on Tuesday, September 15, 2009 10:26 AM:
> On 2009.09.02 22:57:33 +0800, Zhenyu Wang wrote:
>> As DGA is optional in xserver, we should check this too instead
>> of always trying to init DGA.
>> 
>> Found when update xserver to
>> 6fffcd5825454a7fe58ffbcfb219f007cf38e731, 
>> but not update xf86dgaproto, which caused X fails to start.
>> 
>> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> ---
>>  src/i810_driver.c |    2 ++
>>  src/i830_driver.c |    5 ++++-
>>  2 files changed, 6 insertions(+), 1 deletions(-)
>> 
>> diff --git a/src/i810_driver.c b/src/i810_driver.c
>> index a08a500..7961c3d 100644
>> --- a/src/i810_driver.c
>> +++ b/src/i810_driver.c
>> @@ -2024,7 +2024,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr
>>  pScreen, int argc, char **argv)     } #endif
>> 
>> +#ifdef XFreeXDGA
>>     I810DGAInit(pScreen);
>> +#endif
>> 
>>     if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
>>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>> diff --git a/src/i830_driver.c b/src/i830_driver.c
>> index 7e0ebf3..4334de6 100644
>> --- a/src/i830_driver.c
>> +++ b/src/i830_driver.c
>> @@ -2733,7 +2733,10 @@ I830ScreenInit(int scrnIndex, ScreenPtr
>> pScreen, int argc, char **argv) 
>> 
>>     xf86SetBlackWhitePixels(pScreen);
>> 
>> -   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
>> +#ifdef XFreeXDGA +   if (!pI830->use_drm_mode)
>> +       xf86DiDGAInit (pScreen, pI830->LinearAddr +
>> pScrn->fbOffset); +#endif 
>> 
>>     if (!I830AccelInit(pScreen)) {
>>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
>> --
>> 1.5.3.8
> 
> This one also disables DGA in KMS, which introduce
> http://bugs.freedesktop.org/show_bug.cgi?id=23858 Any idea on how to
> enable DGA in KMS? 

I'd suggest to revert the patch if we don't have good idea at this point.

Gordon
Zhenyu Wang Sept. 15, 2009, 7:14 a.m. UTC | #4
On 2009.09.15 15:07:16 +0800, Jin, Gordon wrote:
> Zhenyu Wang wrote on Tuesday, September 15, 2009 10:26 AM:
> > On 2009.09.02 22:57:33 +0800, Zhenyu Wang wrote:
> >> As DGA is optional in xserver, we should check this too instead
> >> of always trying to init DGA.
> >> 
> >> Found when update xserver to
> >> 6fffcd5825454a7fe58ffbcfb219f007cf38e731, 
> >> but not update xf86dgaproto, which caused X fails to start.
> >> 
> >> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> ---
> >>  src/i810_driver.c |    2 ++
> >>  src/i830_driver.c |    5 ++++-
> >>  2 files changed, 6 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/src/i810_driver.c b/src/i810_driver.c
> >> index a08a500..7961c3d 100644
> >> --- a/src/i810_driver.c
> >> +++ b/src/i810_driver.c
> >> @@ -2024,7 +2024,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr
> >>  pScreen, int argc, char **argv)     } #endif
> >> 
> >> +#ifdef XFreeXDGA
> >>     I810DGAInit(pScreen);
> >> +#endif
> >> 
> >>     if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
> >>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> >> diff --git a/src/i830_driver.c b/src/i830_driver.c
> >> index 7e0ebf3..4334de6 100644
> >> --- a/src/i830_driver.c
> >> +++ b/src/i830_driver.c
> >> @@ -2733,7 +2733,10 @@ I830ScreenInit(int scrnIndex, ScreenPtr
> >> pScreen, int argc, char **argv) 
> >> 
> >>     xf86SetBlackWhitePixels(pScreen);
> >> 
> >> -   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
> >> +#ifdef XFreeXDGA +   if (!pI830->use_drm_mode)
> >> +       xf86DiDGAInit (pScreen, pI830->LinearAddr +
> >> pScrn->fbOffset); +#endif 
> >> 
> >>     if (!I830AccelInit(pScreen)) {
> >>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> >> --
> >> 1.5.3.8
> > 
> > This one also disables DGA in KMS, which introduce
> > http://bugs.freedesktop.org/show_bug.cgi?id=23858 Any idea on how to
> > enable DGA in KMS? 
> 
> I'd suggest to revert the patch if we don't have good idea at this point.
> 

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 did not work correctly in KMS before, but some close-source games were
still working makes me think they might just check if DGA proto exists...
Maxim Levitsky Sept. 15, 2009, 11:17 a.m. UTC | #5
On Tue, 2009-09-15 at 15:14 +0800, Zhenyu Wang wrote: 
> On 2009.09.15 15:07:16 +0800, Jin, Gordon wrote:
> > Zhenyu Wang wrote on Tuesday, September 15, 2009 10:26 AM:
> > > On 2009.09.02 22:57:33 +0800, Zhenyu Wang wrote:
> > >> As DGA is optional in xserver, we should check this too instead
> > >> of always trying to init DGA.
> > >> 
> > >> Found when update xserver to
> > >> 6fffcd5825454a7fe58ffbcfb219f007cf38e731, 
> > >> but not update xf86dgaproto, which caused X fails to start.
> > >> 
> > >> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> ---
> > >>  src/i810_driver.c |    2 ++
> > >>  src/i830_driver.c |    5 ++++-
> > >>  2 files changed, 6 insertions(+), 1 deletions(-)
> > >> 
> > >> diff --git a/src/i810_driver.c b/src/i810_driver.c
> > >> index a08a500..7961c3d 100644
> > >> --- a/src/i810_driver.c
> > >> +++ b/src/i810_driver.c
> > >> @@ -2024,7 +2024,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr
> > >>  pScreen, int argc, char **argv)     } #endif
> > >> 
> > >> +#ifdef XFreeXDGA
> > >>     I810DGAInit(pScreen);
> > >> +#endif
> > >> 
> > >>     if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
> > >>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> > >> diff --git a/src/i830_driver.c b/src/i830_driver.c
> > >> index 7e0ebf3..4334de6 100644
> > >> --- a/src/i830_driver.c
> > >> +++ b/src/i830_driver.c
> > >> @@ -2733,7 +2733,10 @@ I830ScreenInit(int scrnIndex, ScreenPtr
> > >> pScreen, int argc, char **argv) 
> > >> 
> > >>     xf86SetBlackWhitePixels(pScreen);
> > >> 
> > >> -   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
> > >> +#ifdef XFreeXDGA +   if (!pI830->use_drm_mode)
> > >> +       xf86DiDGAInit (pScreen, pI830->LinearAddr +
> > >> pScrn->fbOffset); +#endif 
> > >> 
> > >>     if (!I830AccelInit(pScreen)) {
> > >>        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> > >> --
> > >> 1.5.3.8
> > > 
> > > This one also disables DGA in KMS, which introduce
> > > http://bugs.freedesktop.org/show_bug.cgi?id=23858 Any idea on how to
> > > enable DGA in KMS? 
> > 
> > I'd suggest to revert the patch if we don't have good idea at this point.
> > 
> 
> 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 did not work correctly in KMS before, but some close-source games were
> still working makes me think they might just check if DGA proto exists...

Just a note that very recently all SDL based games stopped allowing me
to change resolution.
(Tried: neverball, foobiliard, torcs, supertuxkart, ppracer)

They all say that native resolution (1280x1024) is all that is
supported.

Can that be related?


Best regards,
Maxim Levitsky
Keith Packard Sept. 15, 2009, 3:11 p.m. UTC | #6
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).

> DGA did not work correctly in KMS before, but some close-source games were
> still working makes me think they might just check if DGA proto exists...

The only thing these games use DGA for is to get relative mouse motion;
they don't use it for drawing (at least, very few use it for drawing
anymore). Those requests never come near our driver.

-keith
Zhenyu Wang Sept. 16, 2009, 1:48 a.m. UTC | #7
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).

ok, so looks we have to revert that patch for now.

> 
> > DGA did not work correctly in KMS before, but some close-source games were
> > still working makes me think they might just check if DGA proto exists...
> 
> The only thing these games use DGA for is to get relative mouse motion;
> they don't use it for drawing (at least, very few use it for drawing
> anymore). Those requests never come near our driver.
> 

thanks.
diff mbox

Patch

diff --git a/src/i810_driver.c b/src/i810_driver.c
index a08a500..7961c3d 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -2024,7 +2024,9 @@  I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    }
 #endif
 
+#ifdef XFreeXDGA
    I810DGAInit(pScreen);
+#endif
 
    if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7e0ebf3..4334de6 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2733,7 +2733,10 @@  I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    xf86SetBlackWhitePixels(pScreen);
 
-   xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
+#ifdef XFreeXDGA
+   if (!pI830->use_drm_mode)
+       xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
+#endif
 
    if (!I830AccelInit(pScreen)) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,