diff options
Diffstat (limited to 'xorg-server/hw')
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrdri.c | 5 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrdri.h | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrdriext.c | 23 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrhostglx.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrhostvideo.c | 38 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/ephyrinit.c | 4 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/hostx.h | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/ephyr/os.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/linux/evdev.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/linux/linux.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/linux/mouse.c | 6 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/linux/ps2.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kdrive.c | 6 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kdrive.h | 13 | ||||
-rw-r--r-- | xorg-server/hw/kdrive/src/kinput.c | 11 |
16 files changed, 51 insertions, 71 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrdri.c b/xorg-server/hw/kdrive/ephyr/ephyrdri.c index 50554364c..3a4a06301 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrdri.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrdri.c @@ -137,18 +137,19 @@ ephyrDRIGetClientDriverName(int a_screen, Bool ephyrDRICreateContext(int a_screen, int a_visual_id, - XID *a_returned_ctxt_id, drm_context_t * a_hw_ctxt) + CARD32 ctxt_id, drm_context_t * a_hw_ctxt) { Display *dpy = hostx_get_display(); Bool is_ok = FALSE; Visual v; + XID returned_ctxt_id = ctxt_id; EPHYR_LOG("enter. screen:%d, visual:%d\n", a_screen, a_visual_id); memset(&v, 0, sizeof(v)); v.visualid = a_visual_id; is_ok = XF86DRICreateContext(dpy, DefaultScreen(dpy), - &v, a_returned_ctxt_id, a_hw_ctxt); + &v, &returned_ctxt_id, a_hw_ctxt); EPHYR_LOG("leave:%d\n", is_ok); return is_ok; } diff --git a/xorg-server/hw/kdrive/ephyr/ephyrdri.h b/xorg-server/hw/kdrive/ephyr/ephyrdri.h index d28910f29..8f2d3026e 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrdri.h +++ b/xorg-server/hw/kdrive/ephyr/ephyrdri.h @@ -43,7 +43,7 @@ Bool ephyrDRIGetClientDriverName(int a_screen, char **a_client_driver_name); Bool ephyrDRICreateContext(int a_screen, int a_visual_id, - XID *a_returned_ctx_id, drm_context_t * a_hw_ctx); + CARD32 ctx_id, drm_context_t * a_hw_ctx); Bool ephyrDRIDestroyContext(int a_screen, int a_context_id); Bool ephyrDRICreateDrawable(int a_screen, int a_drawable, drm_drawable_t * a_hw_drawable); diff --git a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c index 144c6e1ac..617ffb158 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c @@ -189,7 +189,6 @@ static void ephyrDRIMoveWindow(WindowPtr a_win, int a_x, int a_y, WindowPtr a_siblings, VTKind a_kind) { - Bool is_ok = FALSE; ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; @@ -214,18 +213,16 @@ ephyrDRIMoveWindow(WindowPtr a_win, EPHYR_LOG("window: %p\n", a_win); if (!a_win->parent) { EPHYR_LOG("cannot move root window\n"); - is_ok = TRUE; - goto out; + return; } win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (!win_priv) { EPHYR_LOG("not a DRI peered window\n"); - is_ok = TRUE; - goto out; + return; } if (!findWindowPairFromLocal(a_win, &pair) || !pair) { EPHYR_LOG_ERROR("failed to get window pair\n"); - goto out; + return; } /*compute position relative to parent window */ x = a_win->drawable.x - a_win->parent->drawable.x; @@ -237,11 +234,6 @@ ephyrDRIMoveWindow(WindowPtr a_win, geo.width = a_win->drawable.width; geo.height = a_win->drawable.height; hostx_set_window_geometry(pair->remote, &geo); - is_ok = TRUE; - - out: - EPHYR_LOG("leave. is_ok:%d\n", is_ok); - /*do cleanup here */ } static Bool @@ -297,7 +289,6 @@ ephyrDRIPositionWindow(WindowPtr a_win, int a_x, int a_y) static void ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) { - Bool is_ok = FALSE; ScreenPtr screen = NULL; EphyrDRIScreenPrivPtr screen_priv = NULL; EphyrDRIWindowPrivPtr win_priv = NULL; @@ -323,7 +314,6 @@ ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) win_priv = GET_EPHYR_DRI_WINDOW_PRIV(a_win); if (!win_priv) { EPHYR_LOG("not a DRI peered window\n"); - is_ok = TRUE; goto out; } if (!findWindowPairFromLocal(a_win, &pair) || !pair) { @@ -343,9 +333,8 @@ ephyrDRIClipNotify(WindowPtr a_win, int a_x, int a_y) * push the clipping region of this window * to the peer window in the host */ - is_ok = hostx_set_window_bounding_rectangles + hostx_set_window_bounding_rectangles (pair->remote, rects, RegionNumRects(&a_win->clipList)); - is_ok = TRUE; out: free(rects); @@ -727,7 +716,6 @@ ProcXF86DRICreateContext(register ClientPtr client) ScreenPtr pScreen; VisualPtr visual; int i = 0; - unsigned long context_id = 0; REQUEST(xXF86DRICreateContextReq); REQUEST_SIZE_MATCH(xXF86DRICreateContextReq); @@ -750,10 +738,9 @@ ProcXF86DRICreateContext(register ClientPtr client) return BadValue; } - context_id = stuff->context; if (!ephyrDRICreateContext(stuff->screen, stuff->visual, - &context_id, + stuff->context, (drm_context_t *) &rep.hHWContext)) { return BadValue; } diff --git a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c index 6a4392fee..5ecb02d23 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrhostglx.c @@ -274,7 +274,6 @@ ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, xGLXGetVisualConfigsReply reply; char *server_glx_version = NULL, *server_glx_extensions = NULL; int j = 0, - screens = 0, major_opcode = 0, num_props = 0, num_visuals = 0, props_buf_size = 0, props_per_visual_size = 0; @@ -282,7 +281,6 @@ ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, EPHYR_RETURN_VAL_IF_FAIL(dpy, FALSE); - screens = ScreenCount(dpy); if (!ephyrHostGLXGetMajorOpcode(&major_opcode)) { EPHYR_LOG_ERROR("failed to get opcode\n"); goto out; diff --git a/xorg-server/hw/kdrive/ephyr/ephyrhostvideo.c b/xorg-server/hw/kdrive/ephyr/ephyrhostvideo.c index 05e9ad9f5..99f0f5071 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrhostvideo.c @@ -58,7 +58,7 @@ #endif /*FALSE*/ static XExtensionInfo _xv_info_data; static XExtensionInfo *xv_info = &_xv_info_data; -static char *xv_extension_name = XvName; +static const char *xv_extension_name = XvName; static char *xv_error_string(Display * dpy, int code, XExtCodes * codes, char *buf, int n); static int xv_close_display(Display * dpy, XExtCodes * codes); @@ -78,7 +78,7 @@ static XExtensionHooks xv_extension_hooks = { xv_error_string /* error_string */ }; -static char *xv_error_list[] = { +static const char *xv_error_list[] = { "BadPort", /* XvBadPort */ "BadEncoding", /* XvBadEncoding */ "BadControl" /* XvBadControl */ @@ -311,7 +311,7 @@ char ephyrHostXVAdaptorGetType(const EphyrHostXVAdaptor * a_this) { EPHYR_RETURN_VAL_IF_FAIL(a_this, -1); - return ((XvAdaptorInfo *) a_this)->type; + return ((const XvAdaptorInfo *) a_this)->type; } const char * @@ -319,7 +319,7 @@ ephyrHostXVAdaptorGetName(const EphyrHostXVAdaptor * a_this) { EPHYR_RETURN_VAL_IF_FAIL(a_this, NULL); - return ((XvAdaptorInfo *) a_this)->name; + return ((const XvAdaptorInfo *) a_this)->name; } EphyrHostVideoFormat * @@ -333,16 +333,16 @@ ephyrHostXVAdaptorGetVideoFormats(const EphyrHostXVAdaptor * a_this, EPHYR_RETURN_VAL_IF_FAIL(a_this, NULL); - nb_formats = ((XvAdaptorInfo *) a_this)->num_formats; + nb_formats = ((const XvAdaptorInfo *) a_this)->num_formats; formats = calloc(nb_formats, sizeof(EphyrHostVideoFormat)); for (i = 0; i < nb_formats; i++) { memset(&visual_info_template, 0, sizeof(visual_info_template)); visual_info_template.visualid = - ((XvAdaptorInfo *) a_this)->formats[i].visual_id; + ((const XvAdaptorInfo *) a_this)->formats[i].visual_id; visual_info = XGetVisualInfo(hostx_get_display(), VisualIDMask, &visual_info_template, &nb_visual_info); - formats[i].depth = ((XvAdaptorInfo *) a_this)->formats[i].depth; + formats[i].depth = ((const XvAdaptorInfo *) a_this)->formats[i].depth; formats[i].visual_class = visual_info->class; XFree(visual_info); } @@ -356,7 +356,7 @@ ephyrHostXVAdaptorGetNbPorts(const EphyrHostXVAdaptor * a_this) { EPHYR_RETURN_VAL_IF_FAIL(a_this, -1); - return ((XvAdaptorInfo *) a_this)->num_ports; + return ((const XvAdaptorInfo *) a_this)->num_ports; } int @@ -364,7 +364,7 @@ ephyrHostXVAdaptorGetFirstPortID(const EphyrHostXVAdaptor * a_this) { EPHYR_RETURN_VAL_IF_FAIL(a_this, -1); - return ((XvAdaptorInfo *) a_this)->base_id; + return ((const XvAdaptorInfo *) a_this)->base_id; } Bool @@ -372,8 +372,8 @@ ephyrHostXVAdaptorHasPutVideo(const EphyrHostXVAdaptor * a_this, Bool *a_result) { EPHYR_RETURN_VAL_IF_FAIL(a_this && a_result, FALSE); - if ((((XvAdaptorInfo *) a_this)->type & (XvVideoMask | XvInputMask)) == - (XvVideoMask | XvInputMask)) + if ((((const XvAdaptorInfo *) a_this)->type & + (XvVideoMask | XvInputMask)) == (XvVideoMask | XvInputMask)) *a_result = TRUE; else *a_result = FALSE; @@ -383,8 +383,8 @@ ephyrHostXVAdaptorHasPutVideo(const EphyrHostXVAdaptor * a_this, Bool *a_result) Bool ephyrHostXVAdaptorHasGetVideo(const EphyrHostXVAdaptor * a_this, Bool *a_result) { - if ((((XvAdaptorInfo *) a_this)->type & (XvVideoMask | XvOutputMask)) == - (XvVideoMask | XvOutputMask)) + if ((((const XvAdaptorInfo *) a_this)->type & + (XvVideoMask | XvOutputMask)) == (XvVideoMask | XvOutputMask)) *a_result = TRUE; else *a_result = FALSE; @@ -396,8 +396,8 @@ ephyrHostXVAdaptorHasPutStill(const EphyrHostXVAdaptor * a_this, Bool *a_result) { EPHYR_RETURN_VAL_IF_FAIL(a_this && a_result, FALSE); - if ((((XvAdaptorInfo *) a_this)->type & (XvStillMask | XvInputMask)) == - (XvStillMask | XvInputMask)) + if ((((const XvAdaptorInfo *) a_this)->type & + (XvStillMask | XvInputMask)) == (XvStillMask | XvInputMask)) *a_result = TRUE; else *a_result = FALSE; @@ -409,8 +409,8 @@ ephyrHostXVAdaptorHasGetStill(const EphyrHostXVAdaptor * a_this, Bool *a_result) { EPHYR_RETURN_VAL_IF_FAIL(a_this && a_result, FALSE); - if ((((XvAdaptorInfo *) a_this)->type & (XvStillMask | XvOutputMask)) == - (XvStillMask | XvOutputMask)) + if ((((const XvAdaptorInfo *) a_this)->type & + (XvStillMask | XvOutputMask)) == (XvStillMask | XvOutputMask)) *a_result = TRUE; else *a_result = FALSE; @@ -422,8 +422,8 @@ ephyrHostXVAdaptorHasPutImage(const EphyrHostXVAdaptor * a_this, Bool *a_result) { EPHYR_RETURN_VAL_IF_FAIL(a_this && a_result, FALSE); - if ((((XvAdaptorInfo *) a_this)->type & (XvImageMask | XvInputMask)) == - (XvImageMask | XvInputMask)) + if ((((const XvAdaptorInfo *) a_this)->type & + (XvImageMask | XvInputMask)) == (XvImageMask | XvInputMask)) *a_result = TRUE; else *a_result = FALSE; diff --git a/xorg-server/hw/kdrive/ephyr/ephyrinit.c b/xorg-server/hw/kdrive/ephyr/ephyrinit.c index 3a8136465..8d134907c 100644 --- a/xorg-server/hw/kdrive/ephyr/ephyrinit.c +++ b/xorg-server/hw/kdrive/ephyr/ephyrinit.c @@ -45,7 +45,7 @@ extern KdPointerDriver LinuxEvdevMouseDriver; extern KdKeyboardDriver LinuxEvdevKeyboardDriver; #endif -void processScreenArg(char *screen_size, char *parent_id); +void processScreenArg(const char *screen_size, char *parent_id); void InitCard(char *name) @@ -136,7 +136,7 @@ ddxUseMsg(void) #endif void -processScreenArg(char *screen_size, char *parent_id) +processScreenArg(const char *screen_size, char *parent_id) { KdCardInfo *card; diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index 438c9f76f..849ea43e0 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -221,7 +221,7 @@ hostx_set_screen_number(EphyrScreenInfo screen, int number) } void -hostx_set_win_title(EphyrScreenInfo screen, char *extra_text) +hostx_set_win_title(EphyrScreenInfo screen, const char *extra_text) { struct EphyrHostScreen *host_screen = host_screen_from_screen_info(screen); diff --git a/xorg-server/hw/kdrive/ephyr/hostx.h b/xorg-server/hw/kdrive/ephyr/hostx.h index a0a5df2ed..04b4ad081 100644 --- a/xorg-server/hw/kdrive/ephyr/hostx.h +++ b/xorg-server/hw/kdrive/ephyr/hostx.h @@ -175,7 +175,7 @@ void hostx_set_screen_number(EphyrScreenInfo screen, int number); void - hostx_set_win_title(EphyrScreenInfo screen, char *extra_text); + hostx_set_win_title(EphyrScreenInfo screen, const char *extra_text); int hostx_get_depth(void); diff --git a/xorg-server/hw/kdrive/ephyr/os.c b/xorg-server/hw/kdrive/ephyr/os.c index a2a705dd9..56b52d143 100644 --- a/xorg-server/hw/kdrive/ephyr/os.c +++ b/xorg-server/hw/kdrive/ephyr/os.c @@ -28,7 +28,7 @@ #endif #include "ephyr.h" -extern void processScreenArg(char *screen_size, char *parent_id); +extern void processScreenArg(const char *screen_size, char *parent_id); static int EphyrInit(void) diff --git a/xorg-server/hw/kdrive/linux/evdev.c b/xorg-server/hw/kdrive/linux/evdev.c index 9982fad36..63e840996 100644 --- a/xorg-server/hw/kdrive/linux/evdev.c +++ b/xorg-server/hw/kdrive/linux/evdev.c @@ -186,7 +186,7 @@ EvdevPtrRead(int evdevPort, void *closure) } } -char *kdefaultEvdev[] = { +const char *kdefaultEvdev[] = { "/dev/input/event0", "/dev/input/event1", "/dev/input/event2", diff --git a/xorg-server/hw/kdrive/linux/linux.c b/xorg-server/hw/kdrive/linux/linux.c index 498c2398d..00de2ae0e 100644 --- a/xorg-server/hw/kdrive/linux/linux.c +++ b/xorg-server/hw/kdrive/linux/linux.c @@ -63,7 +63,7 @@ LinuxVTRequest(int sig) /* Check before chowning -- this avoids touching the file system */ static void -LinuxCheckChown(char *file) +LinuxCheckChown(const char *file) { struct stat st; __uid_t u; diff --git a/xorg-server/hw/kdrive/linux/mouse.c b/xorg-server/hw/kdrive/linux/mouse.c index f4424478a..2bfe7f242 100644 --- a/xorg-server/hw/kdrive/linux/mouse.c +++ b/xorg-server/hw/kdrive/linux/mouse.c @@ -193,7 +193,7 @@ MouseWriteBytes(int fd, unsigned char *c, int n, int timeout) #define MAX_VALID 4 /* number of valid packets before accepting */ typedef struct _kmouseProt { - char *name; + const char *name; Bool (*Complete) (KdPointerInfo * pi, unsigned char *ev, int ne); int (*Valid) (KdPointerInfo * pi, unsigned char *ev, int ne); Bool (*Parse) (KdPointerInfo * pi, unsigned char *ev, int ne); @@ -738,7 +738,7 @@ MouseInitProtocol(Kmouse * km) } static void -MouseFirstProtocol(Kmouse * km, char *prot) +MouseFirstProtocol(Kmouse * km, const char *prot) { if (prot) { for (km->i_prot = 0; km->i_prot < NUM_PROT; km->i_prot++) @@ -887,7 +887,7 @@ MouseRead(int mousePort, void *closure) int MouseInputType; -char *kdefaultMouse[] = { +const char *kdefaultMouse[] = { "/dev/input/mice", "/dev/mouse", "/dev/psaux", diff --git a/xorg-server/hw/kdrive/linux/ps2.c b/xorg-server/hw/kdrive/linux/ps2.c index d1522a2d0..e5417a567 100644 --- a/xorg-server/hw/kdrive/linux/ps2.c +++ b/xorg-server/hw/kdrive/linux/ps2.c @@ -58,7 +58,7 @@ Ps2ReadBytes(int fd, char *buf, int len, int min) return tot; } -char *Ps2Names[] = { +const char *Ps2Names[] = { "/dev/psaux", /* "/dev/mouse", */ "/dev/input/mice", diff --git a/xorg-server/hw/kdrive/src/kdrive.c b/xorg-server/hw/kdrive/src/kdrive.c index 15f9915f2..f2426ca43 100644 --- a/xorg-server/hw/kdrive/src/kdrive.c +++ b/xorg-server/hw/kdrive/src/kdrive.c @@ -248,8 +248,8 @@ ddxGiveUp(enum ExitCode error) Bool kdDumbDriver; Bool kdSoftCursor; -char * -KdParseFindNext(char *cur, const char *delim, char *save, char *last) +const char * +KdParseFindNext(const char *cur, const char *delim, char *save, char *last) { while (*cur && !strchr(delim, *cur)) { *save++ = *cur++; @@ -284,7 +284,7 @@ KdSubRotation(Rotation a, Rotation b) } void -KdParseScreen(KdScreenInfo * screen, char *arg) +KdParseScreen(KdScreenInfo * screen, const char *arg) { char delim; char save[1024]; diff --git a/xorg-server/hw/kdrive/src/kdrive.h b/xorg-server/hw/kdrive/src/kdrive.h index b93dfd6f4..52cde4f0d 100644 --- a/xorg-server/hw/kdrive/src/kdrive.h +++ b/xorg-server/hw/kdrive/src/kdrive.h @@ -174,7 +174,7 @@ typedef enum _kdPointerState { typedef struct _KdPointerInfo KdPointerInfo; typedef struct _KdPointerDriver { - char *name; + const char *name; Status(*Init) (KdPointerInfo *); Status(*Enable) (KdPointerInfo *); void (*Disable) (KdPointerInfo *); @@ -243,7 +243,7 @@ typedef struct { typedef struct _KdKeyboardInfo KdKeyboardInfo; typedef struct _KdKeyboardDriver { - char *name; + const char *name; Bool (*Init) (KdKeyboardInfo *); Bool (*Enable) (KdKeyboardInfo *); void (*Leds) (KdKeyboardInfo *, int); @@ -411,13 +411,14 @@ Rotation KdAddRotation(Rotation a, Rotation b); Rotation KdSubRotation(Rotation a, Rotation b); void - KdParseScreen(KdScreenInfo * screen, char *arg); + KdParseScreen(KdScreenInfo * screen, const char *arg); -KdPointerInfo *KdParsePointer(char *arg); +KdPointerInfo *KdParsePointer(const char *arg); -KdKeyboardInfo *KdParseKeyboard(char *arg); +KdKeyboardInfo *KdParseKeyboard(const char *arg); -char *KdParseFindNext(char *cur, const char *delim, char *save, char *last); +const char * +KdParseFindNext(const char *cur, const char *delim, char *save, char *last); void KdParseRgba(char *rgba); diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c index f8342fb96..0190cdd72 100644 --- a/xorg-server/hw/kdrive/src/kinput.c +++ b/xorg-server/hw/kdrive/src/kinput.c @@ -1109,7 +1109,7 @@ KdParseKbdOptions(KdKeyboardInfo * ki) } KdKeyboardInfo * -KdParseKeyboard(char *arg) +KdParseKeyboard(const char *arg) { char save[1024]; char delim; @@ -1201,7 +1201,7 @@ KdParsePointerOptions(KdPointerInfo * pi) } KdPointerInfo * -KdParsePointer(char *arg) +KdParsePointer(const char *arg) { char save[1024]; char delim; @@ -1698,13 +1698,6 @@ char *kdActionNames[] = { }; #endif /* DEBUG */ -static void -KdQueueEvent(DeviceIntPtr pDev, InternalEvent *ev) -{ - KdAssertSigioBlocked("KdQueueEvent"); - mieqEnqueue(pDev, ev); -} - /* We return true if we're stealing the event. */ static Bool KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y, |