2008-02-04 19:13:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright © 2007 Red Hat, Inc
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software
|
|
|
|
* and its documentation for any purpose is hereby granted without
|
|
|
|
* fee, provided that the above copyright notice appear in all copies
|
|
|
|
* and that both that copyright notice and this permission notice
|
|
|
|
* appear in supporting documentation, and that the name of Red Hat,
|
|
|
|
* Inc not be used in advertising or publicity pertaining to
|
|
|
|
* distribution of the software without specific, written prior
|
|
|
|
* permission. Red Hat, Inc makes no representations about the
|
|
|
|
* suitability of this software for any purpose. It is provided "as
|
|
|
|
* is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
* RED HAT, INC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
|
|
|
* NO EVENT SHALL RED HAT, INC BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <dlfcn.h>
|
|
|
|
|
|
|
|
#include <drm.h>
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/internal/dri_interface.h>
|
2008-03-27 00:28:09 +01:00
|
|
|
#include <GL/glxtokens.h>
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
#include <windowstr.h>
|
|
|
|
#include <os.h>
|
|
|
|
|
|
|
|
#define _XF86DRI_SERVER_
|
|
|
|
#include <xf86drm.h>
|
|
|
|
#include <xf86.h>
|
|
|
|
#include <dri2.h>
|
|
|
|
|
|
|
|
#include "glxserver.h"
|
|
|
|
#include "glxutil.h"
|
2008-05-20 22:36:22 +02:00
|
|
|
#include "glxdricommon.h"
|
2011-12-05 22:52:01 +01:00
|
|
|
#include <GL/glxtokens.h>
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
#include "extension_string.h"
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef struct __GLXDRIscreen __GLXDRIscreen;
|
|
|
|
typedef struct __GLXDRIcontext __GLXDRIcontext;
|
2008-02-04 19:13:35 +01:00
|
|
|
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
|
|
|
|
|
2012-07-05 00:21:09 +02:00
|
|
|
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
|
|
|
|
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE \
|
|
|
|
| __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
struct __GLXDRIscreen {
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLXscreen base;
|
|
|
|
__DRIscreen *driScreen;
|
|
|
|
void *driver;
|
|
|
|
int fd;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
xf86EnterVTProc *enterVT;
|
|
|
|
xf86LeaveVTProc *leaveVT;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
const __DRIcoreExtension *core;
|
2008-08-11 22:59:17 +02:00
|
|
|
const __DRIdri2Extension *dri2;
|
2009-07-16 15:01:17 +02:00
|
|
|
const __DRI2flushExtension *flush;
|
2008-03-27 00:28:09 +01:00
|
|
|
const __DRIcopySubBufferExtension *copySubBuffer;
|
|
|
|
const __DRIswapControlExtension *swapControl;
|
|
|
|
const __DRItexBufferExtension *texBuffer;
|
2011-10-29 22:33:24 +02:00
|
|
|
const __DRIconfig **driConfigs;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct __GLXDRIcontext {
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLXcontext base;
|
|
|
|
__DRIcontext *driContext;
|
2008-02-04 19:13:35 +01:00
|
|
|
};
|
|
|
|
|
2009-04-08 23:54:30 +02:00
|
|
|
#define MAX_DRAWABLE_BUFFERS 5
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
struct __GLXDRIdrawable {
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLXdrawable base;
|
|
|
|
__DRIdrawable *driDrawable;
|
|
|
|
__GLXDRIscreen *screen;
|
2008-08-11 22:59:17 +02:00
|
|
|
|
|
|
|
/* Dimensions as last reported by DRI2GetBuffers. */
|
|
|
|
int width;
|
|
|
|
int height;
|
2009-04-08 23:54:30 +02:00
|
|
|
__DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
|
2008-08-11 22:59:17 +02:00
|
|
|
int count;
|
2012-07-12 13:16:37 +02:00
|
|
|
XID dri2_id;
|
2008-02-04 19:13:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIdrawableDestroy(__GLXdrawable * drawable)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
2008-03-27 00:28:09 +01:00
|
|
|
const __DRIcoreExtension *core = private->screen->core;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2012-07-12 13:16:37 +02:00
|
|
|
FreeResource(private->dri2_id, FALSE);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*core->destroyDrawable) (private->driDrawable);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2009-04-09 19:16:37 +02:00
|
|
|
__glXDrawableRelease(drawable);
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free(private);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2008-10-07 19:49:28 +02:00
|
|
|
static void
|
2014-04-09 20:25:32 +02:00
|
|
|
copy_box(__GLXdrawable * drawable,
|
|
|
|
int dst, int src,
|
|
|
|
int x, int y, int w, int h)
|
2008-10-07 19:49:28 +02:00
|
|
|
{
|
|
|
|
BoxRec box;
|
|
|
|
RegionRec region;
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
2008-10-07 19:49:28 +02:00
|
|
|
|
|
|
|
box.x1 = x;
|
2014-04-09 20:25:32 +02:00
|
|
|
box.y1 = y;
|
2008-10-07 19:49:28 +02:00
|
|
|
box.x2 = x + w;
|
2014-04-09 20:25:32 +02:00
|
|
|
box.y2 = y + h;
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionInit(®ion, &box, 0);
|
2008-10-07 19:49:28 +02:00
|
|
|
|
2014-04-09 20:25:32 +02:00
|
|
|
DRI2CopyRegion(drawable->pDraw, ®ion, dst, src);
|
2014-04-09 19:23:01 +02:00
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
|
|
|
}
|
2008-10-07 19:49:28 +02:00
|
|
|
}
|
|
|
|
|
2009-02-16 12:39:34 +01:00
|
|
|
static void
|
2014-04-09 20:25:32 +02:00
|
|
|
__glXDRIdrawableCopySubBuffer(__GLXdrawable * drawable,
|
|
|
|
int x, int y, int w, int h)
|
2009-02-16 12:39:34 +01:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
|
|
|
|
2014-04-09 20:25:32 +02:00
|
|
|
copy_box(drawable, x, private->height - y - h,
|
|
|
|
w, h,
|
|
|
|
DRI2BufferFrontLeft, DRI2BufferBackLeft);
|
|
|
|
}
|
2009-02-16 12:39:34 +01:00
|
|
|
|
2014-04-09 20:25:32 +02:00
|
|
|
static void
|
|
|
|
__glXDRIdrawableWaitX(__GLXdrawable * drawable)
|
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
|
|
|
|
|
|
|
copy_box(drawable, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft,
|
|
|
|
0, 0, private->width, private->height);
|
2009-02-16 12:39:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIdrawableWaitGL(__GLXdrawable * drawable)
|
2009-02-16 12:39:34 +01:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
|
|
|
|
|
2014-04-09 20:25:32 +02:00
|
|
|
copy_box(drawable, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft,
|
|
|
|
0, 0, private->width, private->height);
|
2009-02-16 12:39:34 +01:00
|
|
|
}
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2010-01-11 20:56:24 +01:00
|
|
|
static void
|
|
|
|
__glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
|
2012-03-21 20:55:09 +01:00
|
|
|
CARD64 msc, CARD32 sbc)
|
2010-01-11 20:56:24 +01:00
|
|
|
{
|
|
|
|
__GLXdrawable *drawable = data;
|
2013-11-22 07:48:31 +01:00
|
|
|
int glx_type;
|
2010-01-11 20:56:24 +01:00
|
|
|
switch (type) {
|
|
|
|
case DRI2_EXCHANGE_COMPLETE:
|
2013-11-22 07:48:31 +01:00
|
|
|
glx_type = GLX_EXCHANGE_COMPLETE_INTEL;
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2013-11-22 07:48:31 +01:00
|
|
|
default:
|
|
|
|
/* unknown swap completion type,
|
|
|
|
* BLIT is a reasonable default, so
|
|
|
|
* fall through ...
|
|
|
|
*/
|
2010-01-11 20:56:24 +01:00
|
|
|
case DRI2_BLIT_COMPLETE:
|
2013-11-22 07:48:31 +01:00
|
|
|
glx_type = GLX_BLIT_COMPLETE_INTEL;
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2010-01-11 20:56:24 +01:00
|
|
|
case DRI2_FLIP_COMPLETE:
|
2013-11-22 07:48:31 +01:00
|
|
|
glx_type = GLX_FLIP_COMPLETE_INTEL;
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2010-01-11 20:56:24 +01:00
|
|
|
}
|
2014-10-31 00:45:12 +01:00
|
|
|
|
2013-11-22 07:48:31 +01:00
|
|
|
__glXsendSwapEvent(drawable, glx_type, ust, msc, sbc);
|
2010-01-11 20:56:24 +01:00
|
|
|
}
|
|
|
|
|
2009-07-16 15:01:17 +02:00
|
|
|
/*
|
|
|
|
* Copy or flip back to front, honoring the swap interval if possible.
|
|
|
|
*
|
|
|
|
* If the kernel supports it, we request an event for the frame when the
|
|
|
|
* swap should happen, then perform the copy when we receive it.
|
|
|
|
*/
|
|
|
|
static GLboolean
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable * drawable)
|
2009-07-16 15:01:17 +02:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable;
|
|
|
|
__GLXDRIscreen *screen = priv->screen;
|
|
|
|
CARD64 unused;
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
|
|
|
int status;
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2010-02-24 16:37:26 +01:00
|
|
|
if (screen->flush) {
|
2012-03-21 20:55:09 +01:00
|
|
|
(*screen->flush->flush) (priv->driDrawable);
|
|
|
|
(*screen->flush->invalidate) (priv->driDrawable);
|
2010-02-24 16:37:26 +01:00
|
|
|
}
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2014-04-09 19:23:01 +02:00
|
|
|
status = DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
|
|
|
|
__glXdriSwapEvent, drawable);
|
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
|
|
|
}
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2014-04-09 19:23:01 +02:00
|
|
|
return status == Success;
|
2009-07-16 15:01:17 +02:00
|
|
|
}
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIdrawableSwapInterval(__GLXdrawable * drawable, int interval)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (interval <= 0) /* || interval > BIGNUM? */
|
|
|
|
return GLX_BAD_VALUE;
|
2009-07-16 15:01:17 +02:00
|
|
|
|
|
|
|
DRI2SwapInterval(drawable->pDraw, interval);
|
2014-04-09 19:23:01 +02:00
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
|
|
|
}
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIcontextDestroy(__GLXcontext * baseContext)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*screen->core->destroyContext) (context->driContext);
|
2008-02-04 19:13:35 +01:00
|
|
|
__glXContextDestroy(&context->base);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(context);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIcontextMakeCurrent(__GLXcontext * baseContext)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
|
|
|
__GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseContext->drawPriv;
|
|
|
|
__GLXDRIdrawable *read = (__GLXDRIdrawable *) baseContext->readPriv;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return (*screen->core->bindContext) (context->driContext,
|
|
|
|
draw->driDrawable, read->driDrawable);
|
|
|
|
}
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIcontextLoseCurrent(__GLXcontext * baseContext)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) context->base.pGlxScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return (*screen->core->unbindContext) (context->driContext);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIcontextCopy(__GLXcontext * baseDst, __GLXcontext * baseSrc,
|
|
|
|
unsigned long mask)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIcontext *dst = (__GLXDRIcontext *) baseDst;
|
|
|
|
__GLXDRIcontext *src = (__GLXDRIcontext *) baseSrc;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) dst->base.pGlxScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return (*screen->core->copyContext) (dst->driContext,
|
|
|
|
src->driContext, mask);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2009-07-16 15:01:17 +02:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIcontextWait(__GLXcontext * baseContext,
|
|
|
|
__GLXclientState * cl, int *error)
|
2009-07-16 15:01:17 +02:00
|
|
|
{
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
|
|
|
Bool ret;
|
|
|
|
|
|
|
|
ret = DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw);
|
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret) {
|
2012-03-21 20:55:09 +01:00
|
|
|
*error = cl->client->noClientException;
|
|
|
|
return TRUE;
|
2009-07-16 15:01:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIbindTexImage(__GLXcontext * baseContext,
|
|
|
|
int buffer, __GLXdrawable * glxPixmap)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2008-03-10 02:40:27 +01:00
|
|
|
__GLXDRIdrawable *drawable = (__GLXDRIdrawable *) glxPixmap;
|
2008-03-27 00:28:09 +01:00
|
|
|
const __DRItexBufferExtension *texBuffer = drawable->screen->texBuffer;
|
|
|
|
__GLXDRIcontext *context = (__GLXDRIcontext *) baseContext;
|
2008-02-15 04:20:56 +01:00
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
if (texBuffer == NULL)
|
2008-02-15 04:20:56 +01:00
|
|
|
return Success;
|
|
|
|
|
2009-04-01 23:42:33 +02:00
|
|
|
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
|
2012-03-21 20:55:09 +01:00
|
|
|
(*texBuffer->setTexBuffer2) (context->driContext,
|
|
|
|
glxPixmap->target,
|
|
|
|
glxPixmap->format, drawable->driDrawable);
|
|
|
|
}
|
|
|
|
else
|
2009-04-08 23:53:46 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
texBuffer->setTexBuffer(context->driContext,
|
|
|
|
glxPixmap->target, drawable->driDrawable);
|
2009-04-01 23:42:33 +02:00
|
|
|
}
|
2008-02-15 04:20:56 +01:00
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIreleaseTexImage(__GLXcontext * baseContext,
|
|
|
|
int buffer, __GLXdrawable * pixmap)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2008-02-15 04:20:56 +01:00
|
|
|
/* FIXME: Just unbind the texture? */
|
2008-02-04 19:13:35 +01:00
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
|
|
|
|
__glXDRIbindTexImage,
|
|
|
|
__glXDRIreleaseTexImage
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIscreenDestroy(__GLXscreen * baseScreen)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2011-10-29 22:33:24 +02:00
|
|
|
int i;
|
|
|
|
|
2013-10-05 09:47:03 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(baseScreen->pScreen);
|
2008-02-04 19:13:35 +01:00
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*screen->core->destroyScreen) (screen->driScreen);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
dlclose(screen->driver);
|
|
|
|
|
|
|
|
__glXScreenDestroy(baseScreen);
|
|
|
|
|
2011-10-29 22:33:24 +02:00
|
|
|
if (screen->driConfigs) {
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; screen->driConfigs[i] != NULL; i++)
|
|
|
|
free((__DRIconfig **) screen->driConfigs[i]);
|
|
|
|
free(screen->driConfigs);
|
2011-10-29 22:33:24 +02:00
|
|
|
}
|
|
|
|
|
2013-10-05 09:47:03 +02:00
|
|
|
pScrn->EnterVT = screen->enterVT;
|
|
|
|
pScrn->LeaveVT = screen->leaveVT;
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free(screen);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2011-12-05 22:52:01 +01:00
|
|
|
static Bool
|
2012-07-12 10:51:52 +02:00
|
|
|
dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs,
|
|
|
|
const uint32_t *attribs,
|
2011-12-05 22:52:01 +01:00
|
|
|
unsigned *major_ver, unsigned *minor_ver,
|
2012-07-05 00:21:09 +02:00
|
|
|
uint32_t *flags, int *api, int *reset, unsigned *error)
|
2011-12-05 22:52:01 +01:00
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
if (num_attribs == 0)
|
|
|
|
return True;
|
|
|
|
|
|
|
|
if (attribs == NULL) {
|
|
|
|
*error = BadImplementation;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
|
|
|
*major_ver = 1;
|
|
|
|
*minor_ver = 0;
|
2012-07-05 00:21:09 +02:00
|
|
|
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
|
2011-12-05 22:52:01 +01:00
|
|
|
|
|
|
|
for (i = 0; i < num_attribs; i++) {
|
|
|
|
switch (attribs[i * 2]) {
|
|
|
|
case GLX_CONTEXT_MAJOR_VERSION_ARB:
|
|
|
|
*major_ver = attribs[i * 2 + 1];
|
|
|
|
break;
|
|
|
|
case GLX_CONTEXT_MINOR_VERSION_ARB:
|
|
|
|
*minor_ver = attribs[i * 2 + 1];
|
|
|
|
break;
|
|
|
|
case GLX_CONTEXT_FLAGS_ARB:
|
|
|
|
*flags = attribs[i * 2 + 1];
|
|
|
|
break;
|
|
|
|
case GLX_RENDER_TYPE:
|
|
|
|
break;
|
2012-07-05 00:21:03 +02:00
|
|
|
case GLX_CONTEXT_PROFILE_MASK_ARB:
|
|
|
|
switch (attribs[i * 2 + 1]) {
|
|
|
|
case GLX_CONTEXT_CORE_PROFILE_BIT_ARB:
|
|
|
|
*api = __DRI_API_OPENGL_CORE;
|
|
|
|
break;
|
|
|
|
case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
|
|
|
|
*api = __DRI_API_OPENGL;
|
|
|
|
break;
|
2012-07-05 00:21:04 +02:00
|
|
|
case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
|
|
|
|
*api = __DRI_API_GLES2;
|
|
|
|
break;
|
2012-07-05 00:21:03 +02:00
|
|
|
default:
|
|
|
|
*error = __glXError(GLXBadProfileARB);
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
break;
|
2012-07-05 00:21:09 +02:00
|
|
|
case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
|
|
|
|
if (screen->dri2->base.version >= 4) {
|
|
|
|
*error = BadValue;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (attribs[i * 2 + 1]) {
|
|
|
|
case GLX_NO_RESET_NOTIFICATION_ARB:
|
|
|
|
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
|
|
|
|
break;
|
|
|
|
case GLX_LOSE_CONTEXT_ON_RESET_ARB:
|
|
|
|
*reset = __DRI_CTX_RESET_LOSE_CONTEXT;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
*error = BadValue;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
break;
|
2011-12-05 22:52:01 +01:00
|
|
|
default:
|
|
|
|
/* If an unknown attribute is received, fail.
|
|
|
|
*/
|
|
|
|
*error = BadValue;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unknown flag value.
|
|
|
|
*/
|
2012-07-05 00:21:09 +02:00
|
|
|
if ((*flags & ~ALL_DRI_CTX_FLAGS) != 0) {
|
2011-12-05 22:52:01 +01:00
|
|
|
*error = BadValue;
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
|
2012-07-05 00:21:03 +02:00
|
|
|
/* If the core profile is requested for a GL version is less than 3.2,
|
|
|
|
* request the non-core profile from the DRI driver. The core profile
|
|
|
|
* only makes sense for GL versions >= 3.2, and many DRI drivers that
|
|
|
|
* don't support OpenGL 3.2 may fail the request for a core profile.
|
|
|
|
*/
|
|
|
|
if (*api == __DRI_API_OPENGL_CORE
|
2012-07-06 02:52:40 +02:00
|
|
|
&& (*major_ver < 3 || (*major_ver == 3 && *minor_ver < 2))) {
|
2012-07-12 11:04:13 +02:00
|
|
|
*api = __DRI_API_OPENGL;
|
2012-07-05 00:21:03 +02:00
|
|
|
}
|
|
|
|
|
2011-12-05 22:52:01 +01:00
|
|
|
*error = Success;
|
|
|
|
return True;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
create_driver_context(__GLXDRIcontext * context,
|
|
|
|
__GLXDRIscreen * screen,
|
|
|
|
__GLXDRIconfig * config,
|
|
|
|
__DRIcontext * driShare,
|
|
|
|
unsigned num_attribs,
|
|
|
|
const uint32_t *attribs,
|
|
|
|
int *error)
|
|
|
|
{
|
|
|
|
context->driContext = NULL;
|
|
|
|
|
|
|
|
if (screen->dri2->base.version >= 3) {
|
2014-10-09 14:42:08 +02:00
|
|
|
uint32_t ctx_attribs[4 * 2];
|
2011-12-05 22:52:01 +01:00
|
|
|
unsigned num_ctx_attribs = 0;
|
|
|
|
unsigned dri_err = 0;
|
|
|
|
unsigned major_ver;
|
|
|
|
unsigned minor_ver;
|
2013-11-15 10:00:53 +01:00
|
|
|
uint32_t flags = 0;
|
2012-07-05 00:21:09 +02:00
|
|
|
int reset;
|
2012-12-17 06:40:17 +01:00
|
|
|
int api = __DRI_API_OPENGL;
|
2011-12-05 22:52:01 +01:00
|
|
|
|
|
|
|
if (num_attribs != 0) {
|
2012-07-12 10:51:52 +02:00
|
|
|
if (!dri2_convert_glx_attribs(screen, num_attribs, attribs,
|
2011-12-05 22:52:01 +01:00
|
|
|
&major_ver, &minor_ver,
|
2012-07-05 00:21:09 +02:00
|
|
|
&flags, &api, &reset,
|
|
|
|
(unsigned *) error))
|
2012-07-12 11:09:15 +02:00
|
|
|
return;
|
2011-12-05 22:52:01 +01:00
|
|
|
|
|
|
|
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION;
|
|
|
|
ctx_attribs[num_ctx_attribs++] = major_ver;
|
|
|
|
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION;
|
|
|
|
ctx_attribs[num_ctx_attribs++] = minor_ver;
|
|
|
|
|
|
|
|
if (flags != 0) {
|
|
|
|
ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS;
|
|
|
|
|
|
|
|
/* The current __DRI_CTX_FLAG_* values are identical to the
|
|
|
|
* GLX_CONTEXT_*_BIT values.
|
|
|
|
*/
|
|
|
|
ctx_attribs[num_ctx_attribs++] = flags;
|
|
|
|
}
|
2012-07-05 00:21:09 +02:00
|
|
|
|
2012-07-12 10:52:34 +02:00
|
|
|
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
|
2012-07-05 00:21:09 +02:00
|
|
|
ctx_attribs[num_ctx_attribs++] =
|
2012-07-12 11:05:41 +02:00
|
|
|
__DRI_CTX_ATTRIB_RESET_STRATEGY;
|
2012-07-05 00:21:09 +02:00
|
|
|
ctx_attribs[num_ctx_attribs++] = reset;
|
|
|
|
}
|
2014-10-09 14:42:08 +02:00
|
|
|
|
|
|
|
assert(num_ctx_attribs <= ARRAY_SIZE(ctx_attribs));
|
2011-12-05 22:52:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
context->driContext =
|
|
|
|
(*screen->dri2->createContextAttribs)(screen->driScreen,
|
2012-07-05 00:21:03 +02:00
|
|
|
api,
|
2011-12-05 22:52:01 +01:00
|
|
|
config->driConfig,
|
|
|
|
driShare,
|
|
|
|
num_ctx_attribs / 2,
|
|
|
|
ctx_attribs,
|
|
|
|
&dri_err,
|
|
|
|
context);
|
|
|
|
|
|
|
|
switch (dri_err) {
|
|
|
|
case __DRI_CTX_ERROR_SUCCESS:
|
|
|
|
*error = Success;
|
|
|
|
break;
|
|
|
|
case __DRI_CTX_ERROR_NO_MEMORY:
|
|
|
|
*error = BadAlloc;
|
|
|
|
break;
|
|
|
|
case __DRI_CTX_ERROR_BAD_API:
|
|
|
|
*error = __glXError(GLXBadProfileARB);
|
|
|
|
break;
|
|
|
|
case __DRI_CTX_ERROR_BAD_VERSION:
|
|
|
|
case __DRI_CTX_ERROR_BAD_FLAG:
|
|
|
|
*error = __glXError(GLXBadFBConfig);
|
|
|
|
break;
|
|
|
|
case __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE:
|
|
|
|
case __DRI_CTX_ERROR_UNKNOWN_FLAG:
|
|
|
|
default:
|
|
|
|
*error = BadValue;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_attribs != 0) {
|
|
|
|
*error = BadValue;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
context->driContext =
|
|
|
|
(*screen->dri2->createNewContext) (screen->driScreen,
|
|
|
|
config->driConfig,
|
|
|
|
driShare, context);
|
|
|
|
}
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static __GLXcontext *
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXDRIscreenCreateContext(__GLXscreen * baseScreen,
|
|
|
|
__GLXconfig * glxConfig,
|
2011-12-05 19:56:07 +01:00
|
|
|
__GLXcontext * baseShareContext,
|
|
|
|
unsigned num_attribs,
|
|
|
|
const uint32_t *attribs,
|
|
|
|
int *error)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
|
|
|
|
__GLXDRIcontext *context, *shareContext;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
2008-02-04 19:13:35 +01:00
|
|
|
__DRIcontext *driShare;
|
|
|
|
|
|
|
|
shareContext = (__GLXDRIcontext *) baseShareContext;
|
|
|
|
if (shareContext)
|
2012-03-21 20:55:09 +01:00
|
|
|
driShare = shareContext->driContext;
|
2008-02-04 19:13:35 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
driShare = NULL;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
context = calloc(1, sizeof *context);
|
2011-12-05 22:52:01 +01:00
|
|
|
if (context == NULL) {
|
|
|
|
*error = BadAlloc;
|
2012-03-21 20:55:09 +01:00
|
|
|
return NULL;
|
2011-12-05 22:52:01 +01:00
|
|
|
}
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
context->base.destroy = __glXDRIcontextDestroy;
|
|
|
|
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
|
|
|
|
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
|
|
|
|
context->base.copy = __glXDRIcontextCopy;
|
2008-02-04 19:13:35 +01:00
|
|
|
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
|
2012-03-21 20:55:09 +01:00
|
|
|
context->base.wait = __glXDRIcontextWait;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2011-12-05 22:52:01 +01:00
|
|
|
create_driver_context(context, screen, config, driShare, num_attribs,
|
|
|
|
attribs, error);
|
2008-10-23 11:28:53 +02:00
|
|
|
if (context->driContext == NULL) {
|
2012-03-21 20:55:09 +01:00
|
|
|
free(context);
|
2008-10-23 11:28:53 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
return &context->base;
|
|
|
|
}
|
|
|
|
|
2010-05-11 16:52:18 +02:00
|
|
|
static void
|
2011-12-18 17:29:41 +01:00
|
|
|
__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
|
2010-05-11 16:52:18 +02:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = priv;
|
|
|
|
__GLXDRIscreen *screen = private->screen;
|
|
|
|
|
2010-06-21 06:08:50 +02:00
|
|
|
if (screen->flush)
|
2012-03-21 20:55:09 +01:00
|
|
|
(*screen->flush->invalidate) (private->driDrawable);
|
2010-05-11 16:52:18 +02:00
|
|
|
}
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static __GLXdrawable *
|
2010-04-29 22:36:10 +02:00
|
|
|
__glXDRIscreenCreateDrawable(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
__GLXscreen * screen,
|
|
|
|
DrawablePtr pDraw,
|
|
|
|
XID drawId,
|
|
|
|
int type, XID glxDrawId, __GLXconfig * glxConfig)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
2008-03-27 00:28:09 +01:00
|
|
|
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
2008-02-04 19:13:35 +01:00
|
|
|
__GLXDRIdrawable *private;
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
|
|
|
Bool ret;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
private = calloc(1, sizeof *private);
|
2008-02-04 19:13:35 +01:00
|
|
|
if (private == NULL)
|
2012-03-21 20:55:09 +01:00
|
|
|
return NULL;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
private->screen = driScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
if (!__glXDrawableInit(&private->base, screen,
|
2012-03-21 20:55:09 +01:00
|
|
|
pDraw, type, glxDrawId, glxConfig)) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(private);
|
2012-03-21 20:55:09 +01:00
|
|
|
return NULL;
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
private->base.destroy = __glXDRIdrawableDestroy;
|
|
|
|
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
2008-02-04 19:13:35 +01:00
|
|
|
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
2012-03-21 20:55:09 +01:00
|
|
|
private->base.waitGL = __glXDRIdrawableWaitGL;
|
|
|
|
private->base.waitX = __glXDRIdrawableWaitX;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2014-04-09 19:23:01 +02:00
|
|
|
ret = DRI2CreateDrawable2(client, pDraw, drawId,
|
|
|
|
__glXDRIinvalidateBuffers, private,
|
|
|
|
&private->dri2_id);
|
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret) {
|
2012-03-21 20:55:09 +01:00
|
|
|
free(private);
|
|
|
|
return NULL;
|
2008-08-11 22:59:17 +02:00
|
|
|
}
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
private->driDrawable =
|
2012-03-21 20:55:09 +01:00
|
|
|
(*driScreen->dri2->createNewDrawable) (driScreen->driScreen,
|
|
|
|
config->driConfig, private);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
return &private->base;
|
|
|
|
}
|
|
|
|
|
2008-08-11 22:59:17 +02:00
|
|
|
static __DRIbuffer *
|
2012-03-21 20:55:09 +01:00
|
|
|
dri2GetBuffers(__DRIdrawable * driDrawable,
|
|
|
|
int *width, int *height,
|
|
|
|
unsigned int *attachments, int count,
|
|
|
|
int *out_count, void *loaderPrivate)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2008-08-11 22:59:17 +02:00
|
|
|
__GLXDRIdrawable *private = loaderPrivate;
|
2009-04-24 21:49:19 +02:00
|
|
|
DRI2BufferPtr *buffers;
|
2008-08-11 22:59:17 +02:00
|
|
|
int i;
|
2009-04-15 20:13:48 +02:00
|
|
|
int j;
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
2008-03-27 00:28:09 +01:00
|
|
|
|
2008-08-11 22:59:17 +02:00
|
|
|
buffers = DRI2GetBuffers(private->base.pDraw,
|
2012-03-21 20:55:09 +01:00
|
|
|
width, height, attachments, count, out_count);
|
2014-04-09 19:23:01 +02:00
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
2014-04-21 10:47:15 +02:00
|
|
|
|
|
|
|
/* If DRI2GetBuffers() changed the GL context, it may also have
|
|
|
|
* invalidated the DRI2 buffers, so let's get them again
|
|
|
|
*/
|
|
|
|
buffers = DRI2GetBuffers(private->base.pDraw,
|
|
|
|
width, height, attachments, count, out_count);
|
|
|
|
assert(lastGLContext == cx);
|
2014-04-09 19:23:01 +02:00
|
|
|
}
|
|
|
|
|
2009-04-08 23:54:30 +02:00
|
|
|
if (*out_count > MAX_DRAWABLE_BUFFERS) {
|
2012-03-21 20:55:09 +01:00
|
|
|
*out_count = 0;
|
|
|
|
return NULL;
|
2008-08-11 22:59:17 +02:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2008-08-11 22:59:17 +02:00
|
|
|
private->width = *width;
|
|
|
|
private->height = *height;
|
|
|
|
|
|
|
|
/* This assumes the DRI2 buffer attachment tokens matches the
|
|
|
|
* __DRIbuffer tokens. */
|
2009-04-15 20:13:48 +02:00
|
|
|
j = 0;
|
2008-08-11 22:59:17 +02:00
|
|
|
for (i = 0; i < *out_count; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Do not send the real front buffer of a window to the client.
|
|
|
|
*/
|
|
|
|
if ((private->base.pDraw->type == DRAWABLE_WINDOW)
|
|
|
|
&& (buffers[i]->attachment == DRI2BufferFrontLeft)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
private->buffers[j].attachment = buffers[i]->attachment;
|
|
|
|
private->buffers[j].name = buffers[i]->name;
|
|
|
|
private->buffers[j].pitch = buffers[i]->pitch;
|
|
|
|
private->buffers[j].cpp = buffers[i]->cpp;
|
|
|
|
private->buffers[j].flags = buffers[i]->flags;
|
|
|
|
j++;
|
2009-04-24 21:49:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
*out_count = j;
|
|
|
|
return private->buffers;
|
|
|
|
}
|
|
|
|
|
|
|
|
static __DRIbuffer *
|
2012-03-21 20:55:09 +01:00
|
|
|
dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
|
|
|
|
int *width, int *height,
|
|
|
|
unsigned int *attachments, int count,
|
|
|
|
int *out_count, void *loaderPrivate)
|
2009-04-24 21:49:19 +02:00
|
|
|
{
|
|
|
|
__GLXDRIdrawable *private = loaderPrivate;
|
|
|
|
DRI2BufferPtr *buffers;
|
|
|
|
int i;
|
|
|
|
int j = 0;
|
2014-04-09 19:23:01 +02:00
|
|
|
__GLXcontext *cx = lastGLContext;
|
2009-04-24 21:49:19 +02:00
|
|
|
|
|
|
|
buffers = DRI2GetBuffersWithFormat(private->base.pDraw,
|
2012-03-21 20:55:09 +01:00
|
|
|
width, height, attachments, count,
|
|
|
|
out_count);
|
2014-04-09 19:23:01 +02:00
|
|
|
if (cx != lastGLContext) {
|
|
|
|
lastGLContext = cx;
|
|
|
|
cx->makeCurrent(cx);
|
2014-04-21 10:47:15 +02:00
|
|
|
|
|
|
|
/* If DRI2GetBuffersWithFormat() changed the GL context, it may also have
|
|
|
|
* invalidated the DRI2 buffers, so let's get them again
|
|
|
|
*/
|
|
|
|
buffers = DRI2GetBuffersWithFormat(private->base.pDraw,
|
|
|
|
width, height, attachments, count,
|
|
|
|
out_count);
|
|
|
|
assert(lastGLContext == cx);
|
2014-04-09 19:23:01 +02:00
|
|
|
}
|
|
|
|
|
2009-04-24 21:49:19 +02:00
|
|
|
if (*out_count > MAX_DRAWABLE_BUFFERS) {
|
2012-03-21 20:55:09 +01:00
|
|
|
*out_count = 0;
|
|
|
|
return NULL;
|
2009-04-24 21:49:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private->width = *width;
|
|
|
|
private->height = *height;
|
|
|
|
|
|
|
|
/* This assumes the DRI2 buffer attachment tokens matches the
|
|
|
|
* __DRIbuffer tokens. */
|
|
|
|
for (i = 0; i < *out_count; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Do not send the real front buffer of a window to the client.
|
|
|
|
*/
|
|
|
|
if ((private->base.pDraw->type == DRAWABLE_WINDOW)
|
|
|
|
&& (buffers[i]->attachment == DRI2BufferFrontLeft)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
private->buffers[j].attachment = buffers[i]->attachment;
|
|
|
|
private->buffers[j].name = buffers[i]->name;
|
|
|
|
private->buffers[j].pitch = buffers[i]->pitch;
|
|
|
|
private->buffers[j].cpp = buffers[i]->cpp;
|
|
|
|
private->buffers[j].flags = buffers[i]->flags;
|
|
|
|
j++;
|
2008-08-11 22:59:17 +02:00
|
|
|
}
|
2008-03-27 00:28:09 +01:00
|
|
|
|
2009-04-15 20:13:48 +02:00
|
|
|
*out_count = j;
|
2008-08-11 22:59:17 +02:00
|
|
|
return private->buffers;
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void
|
|
|
|
dri2FlushFrontBuffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
2009-04-16 21:10:34 +02:00
|
|
|
{
|
|
|
|
(void) driDrawable;
|
|
|
|
__glXDRIdrawableWaitGL((__GLXdrawable *) loaderPrivate);
|
|
|
|
}
|
|
|
|
|
2008-08-11 22:59:17 +02:00
|
|
|
static const __DRIdri2LoaderExtension loaderExtension = {
|
2013-11-15 02:40:46 +01:00
|
|
|
{__DRI_DRI2_LOADER, 3},
|
2008-08-11 22:59:17 +02:00
|
|
|
dri2GetBuffers,
|
2009-04-16 21:10:34 +02:00
|
|
|
dri2FlushFrontBuffer,
|
2009-04-24 21:49:19 +02:00
|
|
|
dri2GetBuffersWithFormat,
|
2008-02-04 19:13:35 +01:00
|
|
|
};
|
|
|
|
|
2010-05-11 16:52:18 +02:00
|
|
|
static const __DRIuseInvalidateExtension dri2UseInvalidate = {
|
2013-11-15 02:40:46 +01:00
|
|
|
{__DRI_USE_INVALIDATE, 1}
|
2010-05-11 16:52:18 +02:00
|
|
|
};
|
|
|
|
|
2008-02-29 21:10:36 +01:00
|
|
|
static const __DRIextension *loader_extensions[] = {
|
|
|
|
&systemTimeExtension.base,
|
2008-03-27 00:28:09 +01:00
|
|
|
&loaderExtension.base,
|
2010-12-28 13:40:31 +01:00
|
|
|
&dri2UseInvalidate.base,
|
2008-02-29 21:10:36 +01:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
glxDRIEnterVT(ScrnInfoPtr scrn)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Bool ret;
|
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
glxGetScreen(xf86ScrnToScreen(scrn));
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
|
|
|
|
|
2010-07-13 01:01:34 +02:00
|
|
|
scrn->EnterVT = screen->enterVT;
|
|
|
|
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
ret = scrn->EnterVT(scrn);
|
2010-07-13 01:01:34 +02:00
|
|
|
|
|
|
|
screen->enterVT = scrn->EnterVT;
|
|
|
|
scrn->EnterVT = glxDRIEnterVT;
|
|
|
|
|
|
|
|
if (!ret)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
glxResumeClients();
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
glxDRILeaveVT(ScrnInfoPtr scrn)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
|
|
|
__GLXDRIscreen *screen = (__GLXDRIscreen *)
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
glxGetScreen(xf86ScrnToScreen(scrn));
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2013-04-30 07:44:37 +02:00
|
|
|
LogMessageVerbSigSafe(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n");
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
glxSuspendClients();
|
|
|
|
|
2010-07-13 01:01:34 +02:00
|
|
|
scrn->LeaveVT = screen->leaveVT;
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
(*screen->leaveVT) (scrn);
|
2010-07-13 01:01:34 +02:00
|
|
|
screen->leaveVT = scrn->LeaveVT;
|
|
|
|
scrn->LeaveVT = glxDRILeaveVT;
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2013-10-21 19:48:38 +02:00
|
|
|
/**
|
|
|
|
* Initialize extension flags in glx_enable_bits when a new screen is created
|
|
|
|
*
|
|
|
|
* @param screen The screen where glx_enable_bits are to be set.
|
|
|
|
*/
|
2008-02-04 19:13:35 +01:00
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
initializeExtensions(__GLXDRIscreen * screen)
|
2008-02-04 19:13:35 +01:00
|
|
|
{
|
2010-03-23 17:47:08 +01:00
|
|
|
ScreenPtr pScreen = screen->base.pScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
const __DRIextension **extensions;
|
|
|
|
int i;
|
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
extensions = screen->core->getExtensions(screen->driScreen);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
|
2008-08-11 22:59:17 +02:00
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2011-12-05 22:52:01 +01:00
|
|
|
if (screen->dri2->base.version >= 3) {
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_ARB_create_context");
|
2012-07-05 00:21:03 +02:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_ARB_create_context_profile");
|
2016-01-20 21:43:10 +01:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_EXT_create_context_es_profile");
|
2012-07-05 00:21:04 +02:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_EXT_create_context_es2_profile");
|
2011-12-05 22:52:01 +01:00
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n");
|
2012-07-05 00:21:03 +02:00
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n");
|
2012-07-05 00:21:04 +02:00
|
|
|
LogMessage(X_INFO,
|
2016-01-20 21:43:10 +01:00
|
|
|
"AIGLX: enabled GLX_EXT_create_context_es{,2}_profile\n");
|
2011-12-05 22:52:01 +01:00
|
|
|
}
|
|
|
|
|
2010-03-23 17:47:08 +01:00
|
|
|
if (DRI2HasSwapControl(pScreen)) {
|
2013-02-15 00:06:57 +01:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
|
2012-03-21 20:55:09 +01:00
|
|
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control");
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control");
|
2013-02-15 00:06:57 +01:00
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
|
2012-03-21 20:55:09 +01:00
|
|
|
LogMessage(X_INFO,
|
|
|
|
"AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");
|
2010-03-23 17:47:08 +01:00
|
|
|
}
|
|
|
|
|
2013-03-11 10:21:28 +01:00
|
|
|
/* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */
|
|
|
|
{
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_EXT_framebuffer_sRGB");
|
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n");
|
|
|
|
}
|
|
|
|
|
2013-10-21 19:48:38 +02:00
|
|
|
/* enable ARB_fbconfig_float extension (even if there are no float fbconfigs) */
|
|
|
|
{
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float");
|
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_fbconfig_float\n");
|
|
|
|
}
|
|
|
|
|
2008-08-11 22:59:17 +02:00
|
|
|
for (i = 0; extensions[i]; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_SGI_make_current_read");
|
2009-07-03 00:24:54 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
|
|
|
|
}
|
2009-07-03 00:24:54 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
|
|
|
|
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
|
|
|
|
/* GLX_EXT_texture_from_pixmap is always enabled. */
|
|
|
|
LogMessage(X_INFO,
|
|
|
|
"AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
|
|
|
|
}
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
|
|
|
|
extensions[i]->version >= 3) {
|
|
|
|
screen->flush = (__DRI2flushExtension *) extensions[i];
|
|
|
|
}
|
2009-07-16 15:01:17 +02:00
|
|
|
|
2012-07-05 00:21:09 +02:00
|
|
|
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
|
|
|
|
screen->dri2->base.version >= 3) {
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_ARB_create_context_robustness");
|
|
|
|
LogMessage(X_INFO,
|
|
|
|
"AIGLX: enabled GLX_ARB_create_context_robustness\n");
|
|
|
|
}
|
|
|
|
|
2015-05-19 17:31:25 +02:00
|
|
|
#ifdef __DRI2_FLUSH_CONTROL
|
|
|
|
if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) {
|
|
|
|
__glXEnableExtension(screen->glx_enable_bits,
|
|
|
|
"GLX_ARB_context_flush_control\n");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Ignore unknown extensions */
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
}
|
2008-03-27 00:28:09 +01:00
|
|
|
|
2013-12-03 21:02:57 +01:00
|
|
|
/* white lie */
|
|
|
|
extern glx_func_ptr glXGetProcAddressARB(const char *);
|
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
static __GLXscreen *
|
|
|
|
__glXDRIscreenProbe(ScreenPtr pScreen)
|
|
|
|
{
|
2008-10-07 19:49:28 +02:00
|
|
|
const char *driverName, *deviceName;
|
2008-02-04 19:13:35 +01:00
|
|
|
__GLXDRIscreen *screen;
|
|
|
|
size_t buffer_size;
|
2012-04-10 16:47:33 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
screen = calloc(1, sizeof *screen);
|
2008-02-04 19:13:35 +01:00
|
|
|
if (screen == NULL)
|
2012-03-21 20:55:09 +01:00
|
|
|
return NULL;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-10-16 20:56:25 +02:00
|
|
|
if (!DRI2Connect(serverClient, pScreen, DRI2DriverDRI,
|
2012-03-21 20:55:09 +01:00
|
|
|
&screen->fd, &driverName, &deviceName)) {
|
|
|
|
LogMessage(X_INFO,
|
|
|
|
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
|
2013-02-10 19:24:59 +01:00
|
|
|
goto handle_error;
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
screen->base.destroy = __glXDRIscreenDestroy;
|
|
|
|
screen->base.createContext = __glXDRIscreenCreateContext;
|
2008-02-04 19:13:35 +01:00
|
|
|
screen->base.createDrawable = __glXDRIscreenCreateDrawable;
|
2012-03-21 20:55:09 +01:00
|
|
|
screen->base.swapInterval = __glXDRIdrawableSwapInterval;
|
|
|
|
screen->base.pScreen = pScreen;
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
__glXInitExtensionEnableBits(screen->glx_enable_bits);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
screen->driver =
|
|
|
|
glxProbeDriver(driverName, (void **) &screen->core, __DRI_CORE, 1,
|
|
|
|
(void **) &screen->dri2, __DRI_DRI2, 1);
|
2008-02-04 19:13:35 +01:00
|
|
|
if (screen->driver == NULL) {
|
|
|
|
goto handle_error;
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2008-03-27 00:28:09 +01:00
|
|
|
screen->driScreen =
|
2012-03-21 20:55:09 +01:00
|
|
|
(*screen->dri2->createNewScreen) (pScreen->myNum,
|
|
|
|
screen->fd,
|
|
|
|
loader_extensions,
|
|
|
|
&screen->driConfigs, screen);
|
2008-03-27 00:28:09 +01:00
|
|
|
|
|
|
|
if (screen->driScreen == NULL) {
|
2012-03-21 20:55:09 +01:00
|
|
|
LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed\n");
|
|
|
|
goto handle_error;
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
initializeExtensions(screen);
|
|
|
|
|
2011-10-29 22:33:24 +02:00
|
|
|
screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs,
|
2012-03-21 20:55:09 +01:00
|
|
|
GLX_WINDOW_BIT |
|
|
|
|
GLX_PIXMAP_BIT |
|
|
|
|
GLX_PBUFFER_BIT);
|
2008-03-27 00:28:09 +01:00
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
__glXScreenInit(&screen->base, pScreen);
|
|
|
|
|
2009-02-16 21:08:28 +01:00
|
|
|
/* The first call simply determines the length of the extension string.
|
|
|
|
* This allows us to allocate some memory to hold the extension string,
|
|
|
|
* but it requires that we call __glXGetExtensionString a second time.
|
|
|
|
*/
|
2008-02-04 19:13:35 +01:00
|
|
|
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
|
|
|
|
if (buffer_size > 0) {
|
2012-03-21 20:55:09 +01:00
|
|
|
free(screen->base.GLXextensions);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
screen->base.GLXextensions = xnfalloc(buffer_size);
|
|
|
|
(void) __glXGetExtensionString(screen->glx_enable_bits,
|
|
|
|
screen->base.GLXextensions);
|
2008-02-04 19:13:35 +01:00
|
|
|
}
|
|
|
|
|
2009-10-01 19:39:19 +02:00
|
|
|
/* We're going to assume (perhaps incorrectly?) that all DRI2-enabled
|
|
|
|
* drivers support the required extensions for GLX 1.4. The extensions
|
2009-09-30 01:43:43 +02:00
|
|
|
* we're assuming are:
|
|
|
|
*
|
|
|
|
* - GLX_SGI_make_current_read (1.3)
|
|
|
|
* - GLX_SGIX_fbconfig (1.3)
|
|
|
|
* - GLX_SGIX_pbuffer (1.3)
|
|
|
|
* - GLX_ARB_multisample (1.4)
|
|
|
|
*/
|
|
|
|
screen->base.GLXmajor = 1;
|
|
|
|
screen->base.GLXminor = 4;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2008-02-04 19:13:35 +01:00
|
|
|
screen->enterVT = pScrn->EnterVT;
|
2012-03-21 20:55:09 +01:00
|
|
|
pScrn->EnterVT = glxDRIEnterVT;
|
2008-02-04 19:13:35 +01:00
|
|
|
screen->leaveVT = pScrn->LeaveVT;
|
|
|
|
pScrn->LeaveVT = glxDRILeaveVT;
|
|
|
|
|
2013-12-03 21:02:57 +01:00
|
|
|
__glXsetGetProcAddress(glXGetProcAddressARB);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
return &screen->base;
|
|
|
|
|
|
|
|
handle_error:
|
|
|
|
if (screen->driver)
|
|
|
|
dlclose(screen->driver);
|
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free(screen);
|
2008-02-04 19:13:35 +01:00
|
|
|
|
|
|
|
LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-12-03 02:33:43 +01:00
|
|
|
_X_EXPORT __GLXprovider __glXDRI2Provider = {
|
2008-02-04 19:13:35 +01:00
|
|
|
__glXDRIscreenProbe,
|
|
|
|
"DRI2",
|
|
|
|
NULL
|
|
|
|
};
|