[PATCH] Re-fix DGA removal.

Rémi Cardona remi at gentoo.org
Thu Oct 1 01:25:25 PDT 2009


Le 30/09/2009 20:40, Keith Packard a écrit :
> Here's an updated patch -- removes the _X_INTERNAL from the .c files,
> renames xf86DiDGAInit to _xf86_di_dga_init_internal, and renames
> xf86DiDGAReInit to _xf86_di_dga_reinit_internal.
>
> Thanks for previous review.
>
> -keith
>
>> From 894680ec0335d7bc2c744c53f6a28b40ab850b6c Mon Sep 17 00:00:00 2001
> From: Keith Packard<keithp at keithp.com>
> Date: Mon, 28 Sep 2009 12:39:47 -0700
> Subject: [PATCH] Re-fix DGA removal.
>
> Removing DGA ended up breaking any drivers calling into the old
> xf86DiDGAInit function as it tried to see if DGA was already enabled
> and ended up crashing if the VT wasn't completely initialized. Oops.
>
> Also, if the driver initializes DGA itself, have the DiDGA
> initialization overwrite that information as the DiDGA code will call
> ReInit on mode detect.
>
> Signed-off-by: Keith Packard<keithp at keithp.com>
> ---
>   hw/xfree86/common/xf86DGA.c  |   29 ++++++++++++++++-------------
>   hw/xfree86/modes/xf86Crtc.c  |    4 ++--
>   hw/xfree86/modes/xf86Crtc.h  |    8 ++++++++
>   hw/xfree86/modes/xf86DiDGA.c |   15 ++++++++++++---
>   4 files changed, 38 insertions(+), 18 deletions(-)
>
> diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
> index 42b7c58..804fd37 100644
> --- a/hw/xfree86/common/xf86DGA.c
> +++ b/hw/xfree86/common/xf86DGA.c
> @@ -120,8 +120,22 @@ DGAInit(
>
>       DGAScreenKey =&DGAScreenKeyIndex;
>
> -    if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
> -	return FALSE;
> +    pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
> +
> +    if (!pScreenPriv)
> +    {
> +	if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
                            ^^^^^^^^^^^^^^
Isn't that useless these days?

Rémi


More information about the xorg-devel mailing list