[PATCH] dix: be more verbose when we run out of opcodes
Peter Hutterer
peter.hutterer at who-t.net
Fri Mar 12 13:33:40 PST 2010
On Fri, Mar 12, 2010 at 12:01:41PM -0300, Paulo Ricardo Zanoni wrote:
> From c54afc8805dbc9482a1b6c8b85caf0aad2820fe9 Mon Sep 17 00:00:00 2001
> From: Paulo Ricardo Zanoni <pzanoni at mandriva.com>
> Date: Thu, 11 Mar 2010 14:28:18 -0300
> Subject: [PATCH] dix: be more verbose when we run out of opcodes
>
> If we run out of opcodes, nothing is print on the log, making the
> problem hard to debug. In the current Xserver, if you enable some
> extensions like multibuffer (+2 events) and use nvidia binary driver (+5
> events) you can run out of opcode numbers.
>
> Signed-off-by: Paulo Ricardo Zanoni <pzanoni at mandriva.com>
> ---
> dix/extension.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/dix/extension.c b/dix/extension.c
> index fb83af1..30dc313 100644
> --- a/dix/extension.c
> +++ b/dix/extension.c
> @@ -83,8 +83,11 @@ AddExtension(char *name, int NumEvents, int NumErrors,
> if (!MainProc || !SwappedMainProc || !MinorOpcodeProc)
> return((ExtensionEntry *) NULL);
> if ((lastEvent + NumEvents > LAST_EVENT) ||
> - (unsigned)(lastError + NumErrors > LAST_ERROR))
> + (unsigned)(lastError + NumErrors > LAST_ERROR)) {
> + LogMessage(X_ERROR, "Not enabling extension %s: maximum number of "
> + "events or errors exceeded.\n", name);
> return((ExtensionEntry *) NULL);
> + }
>
> ext = xalloc(sizeof(ExtensionEntry));
> if (!ext)
> --
> 1.6.4.4
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
More information about the xorg-devel
mailing list