xserver: Branch 'master' - 2 commits
Eamon Walsh
ewalsh at kemper.freedesktop.org
Fri Aug 28 20:53:36 PDT 2009
dix/protocol.txt | 8 ++++++++
hw/xfree86/dri2/dri2ext.c | 25 ++++++++++++++++---------
2 files changed, 24 insertions(+), 9 deletions(-)
New commits:
commit 24716b9254fa7d609792596723a192bb044a7d3f
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Fri Aug 28 22:52:48 2009 -0400
xace: fix up access modes in dixLookupDrawable calls from dri2.
Referencing a screen through a drawable only requires GetAttr access.
Treat dri2 drawables as child windows (Add/Remove access).
Treat getting buffers as intent to read/write the drawable.
Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 029dce8..72f9a44 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -53,10 +53,10 @@ static ExtensionEntry *dri2Extension;
static RESTYPE dri2DrawableRes;
static Bool
-validDrawable(ClientPtr client, XID drawable,
+validDrawable(ClientPtr client, XID drawable, Mask access_mode,
DrawablePtr *pDrawable, int *status)
{
- *status = dixLookupDrawable(pDrawable, drawable, client, 0, DixReadAccess);
+ *status = dixLookupDrawable(pDrawable, drawable, client, 0, access_mode);
if (*status != Success) {
client->errorValue = drawable;
return FALSE;
@@ -105,7 +105,8 @@ ProcDRI2Connect(ClientPtr client)
const char *deviceName;
REQUEST_SIZE_MATCH(xDRI2ConnectReq);
- if (!validDrawable(client, stuff->window, &pDraw, &status))
+ if (!validDrawable(client, stuff->window, DixGetAttrAccess,
+ &pDraw, &status))
return status;
rep.type = X_Reply;
@@ -140,7 +141,8 @@ ProcDRI2Authenticate(ClientPtr client)
int status;
REQUEST_SIZE_MATCH(xDRI2AuthenticateReq);
- if (!validDrawable(client, stuff->window, &pDraw, &status))
+ if (!validDrawable(client, stuff->window, DixGetAttrAccess,
+ &pDraw, &status))
return status;
rep.type = X_Reply;
@@ -161,7 +163,8 @@ ProcDRI2CreateDrawable(ClientPtr client)
REQUEST_SIZE_MATCH(xDRI2CreateDrawableReq);
- if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
+ if (!validDrawable(client, stuff->drawable, DixAddAccess,
+ &pDrawable, &status))
return status;
status = DRI2CreateDrawable(pDrawable);
@@ -184,7 +187,8 @@ ProcDRI2DestroyDrawable(ClientPtr client)
int status;
REQUEST_SIZE_MATCH(xDRI2DestroyDrawableReq);
- if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
+ if (!validDrawable(client, stuff->drawable, DixRemoveAccess,
+ &pDrawable, &status))
return status;
FreeResourceByType(stuff->drawable, dri2DrawableRes, FALSE);
@@ -250,7 +254,8 @@ ProcDRI2GetBuffers(ClientPtr client)
unsigned int *attachments;
REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4);
- if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
+ if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
+ &pDrawable, &status))
return status;
attachments = (unsigned int *) &stuff[1];
@@ -273,7 +278,8 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client)
unsigned int *attachments;
REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4));
- if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
+ if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess,
+ &pDrawable, &status))
return status;
attachments = (unsigned int *) &stuff[1];
@@ -296,7 +302,8 @@ ProcDRI2CopyRegion(ClientPtr client)
REQUEST_SIZE_MATCH(xDRI2CopyRegionReq);
- if (!validDrawable(client, stuff->drawable, &pDrawable, &status))
+ if (!validDrawable(client, stuff->drawable, DixWriteAccess,
+ &pDrawable, &status))
return status;
VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess);
commit 0f3a64c3a5bce6cf3f00fe42cc7d1d3e69822945
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date: Thu Aug 27 15:11:12 2009 -0400
Add DRI2 requests to protocol.txt
Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
diff --git a/dix/protocol.txt b/dix/protocol.txt
index ac81c44..8e152ed 100644
--- a/dix/protocol.txt
+++ b/dix/protocol.txt
@@ -116,6 +116,14 @@ R004 DPMS:Enable
R005 DPMS:Disable
R006 DPMS:ForceLevel
R007 DPMS:Info
+R000 DRI2:QueryVersion
+R001 DRI2:Connect
+R002 DRI2:Authenticate
+R003 DRI2:CreateDrawable
+R004 DRI2:DestroyDrawable
+R005 DRI2:GetBuffers
+R006 DRI2:CopyRegion
+R007 DRI2:GetBuffersWithFormat
R000 Extended-Visual-Information:QueryVersion
R001 Extended-Visual-Information:GetVisualInfo
R000 FontCache:QueryVersion
More information about the xorg-commit
mailing list