Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
d6872d4e
Unverified
Commit
d6872d4e
authored
Nov 02, 2019
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/simplify_nxshm' into 3.6.x
Attributes GH PR #859:
https://github.com/ArcticaProject/nx-libs/pull/859
parents
7afe9553
6fd0ffc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
145 deletions
+35
-145
shm.c
nx-X11/programs/Xserver/Xext/shm.c
+13
-5
NXshm.c
nx-X11/programs/Xserver/hw/nxagent/NXshm.c
+22
-140
No files found.
nx-X11/programs/Xserver/Xext/shm.c
View file @
d6872d4e
...
...
@@ -490,9 +490,12 @@ ProcShmDetach(client)
return
(
client
->
noClientException
);
}
#ifndef NXAGENT_SERVER
static
void
#ifdef NXAGENT_SERVER
xorg_miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
)
#else
miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
)
#endif
DrawablePtr
dst
;
GCPtr
pGC
;
int
depth
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
;
...
...
@@ -525,6 +528,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
(
*
pmap
->
drawable
.
pScreen
->
DestroyPixmap
)(
pmap
);
}
#ifndef NXAGENT_SERVER
static
void
fbShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
)
DrawablePtr
dst
;
...
...
@@ -1138,9 +1142,12 @@ CreatePmap:
return
(
BadAlloc
);
}
#ifndef NXAGENT_SERVER
static
int
#ifdef NXAGENT_SERVER
xorg_ProcShmDispatch
(
client
)
#else
ProcShmDispatch
(
client
)
#endif
register
ClientPtr
client
;
{
REQUEST
(
xReq
);
...
...
@@ -1174,7 +1181,6 @@ ProcShmDispatch (client)
return
BadRequest
;
}
}
#endif
/* NXAGENT_SERVER */
static
void
SShmCompletionEvent
(
from
,
to
)
...
...
@@ -1278,9 +1284,12 @@ SProcShmCreatePixmap(client)
return
ProcShmCreatePixmap
(
client
);
}
#ifndef NXAGENT_SERVER
static
int
#ifdef NXAGENT_SERVER
xorg_SProcShmDispatch
(
client
)
#else
SProcShmDispatch
(
client
)
#endif
register
ClientPtr
client
;
{
REQUEST
(
xReq
);
...
...
@@ -1302,4 +1311,3 @@ SProcShmDispatch (client)
return
BadRequest
;
}
}
#endif
/* NXAGENT_SERVER */
nx-X11/programs/Xserver/hw/nxagent/NXshm.c
View file @
d6872d4e
...
...
@@ -164,42 +164,6 @@ ShmExtensionInit(void)
}
static
void
nxagent_miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
)
DrawablePtr
dst
;
GCPtr
pGC
;
int
depth
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
;
unsigned
int
format
;
char
*
data
;
{
PixmapPtr
pmap
;
GCPtr
putGC
;
putGC
=
GetScratchGC
(
depth
,
dst
->
pScreen
);
if
(
!
putGC
)
{
return
;
}
pmap
=
(
*
dst
->
pScreen
->
CreatePixmap
)(
dst
->
pScreen
,
sw
,
sh
,
depth
,
CREATE_PIXMAP_USAGE_SCRATCH
);
if
(
!
pmap
)
{
FreeScratchGC
(
putGC
);
return
;
}
ValidateGC
((
DrawablePtr
)
pmap
,
putGC
);
(
*
putGC
->
ops
->
PutImage
)((
DrawablePtr
)
pmap
,
putGC
,
depth
,
-
sx
,
-
sy
,
w
,
h
,
0
,
(
format
==
XYPixmap
)
?
XYPixmap
:
ZPixmap
,
data
);
FreeScratchGC
(
putGC
);
if
(
format
==
XYBitmap
)
(
void
)(
*
pGC
->
ops
->
CopyPlane
)((
DrawablePtr
)
pmap
,
dst
,
pGC
,
0
,
0
,
sw
,
sh
,
dx
,
dy
,
1L
);
else
(
void
)(
*
pGC
->
ops
->
CopyArea
)((
DrawablePtr
)
pmap
,
dst
,
pGC
,
0
,
0
,
sw
,
sh
,
dx
,
dy
);
(
*
pmap
->
drawable
.
pScreen
->
DestroyPixmap
)(
pmap
);
}
static
void
miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
)
DrawablePtr
dst
;
GCPtr
pGC
;
...
...
@@ -211,7 +175,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
nxagentShmTrap
=
0
;
nxagent
_miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
);
xorg
_miShmPutImage
(
dst
,
pGC
,
depth
,
format
,
w
,
h
,
sx
,
sy
,
sw
,
sh
,
dx
,
dy
,
data
);
nxagentShmTrap
=
1
;
...
...
@@ -486,77 +450,26 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
return
result
;
}
/* A wrapper that handles the trap. This construct is used
to keep the derived code closer to the original
*/
static
int
nxagent_ProcShmDispatch
(
client
)
register
ClientPtr
client
;
ProcShmDispatch
(
register
ClientPtr
client
)
{
REQUEST
(
xReq
)
;
int
result
;
#ifdef NXAGENT_SERVER
#ifdef TEST
fprintf
(
stderr
,
"ProcShmDispatch: Going to execute operation [%d] for client [%d].
\n
"
,
stuff
->
data
,
client
->
index
);
REQUEST
(
xReq
);
if
(
stuff
->
data
<=
X_ShmCreatePixmap
)
{
fprintf
(
stderr
,
"ProcShmDispatch: Request [%s] OPCODE
#%d
.
\n
"
,
nxagentShmRequestLiteral
[
stuff
->
data
],
stuff
->
data
);
fprintf
(
stderr
,
"ProcShmDispatch: Request [%s] OPCODE
[%d] for client [%d]
.
\n
"
,
nxagentShmRequestLiteral
[
stuff
->
data
],
stuff
->
data
,
client
->
index
);
}
#endif
#endif
switch
(
stuff
->
data
)
{
case
X_ShmQueryVersion
:
return
ProcShmQueryVersion
(
client
);
case
X_ShmAttach
:
return
ProcShmAttach
(
client
);
case
X_ShmDetach
:
return
ProcShmDetach
(
client
);
case
X_ShmPutImage
:
{
#ifdef NXAGENT_SERVER
#ifdef TEST
fprintf
(
stderr
,
"ProcShmDispatch: Going to execute ProcShmPutImage() for client [%d].
\n
"
,
client
->
index
);
#endif
#endif
#ifdef PANORAMIX
if
(
!
noPanoramiXExtension
)
return
ProcPanoramiXShmPutImage
(
client
);
#endif
return
ProcShmPutImage
(
client
);
}
case
X_ShmGetImage
:
#ifdef PANORAMIX
if
(
!
noPanoramiXExtension
)
return
ProcPanoramiXShmGetImage
(
client
);
#endif
return
ProcShmGetImage
(
client
);
case
X_ShmCreatePixmap
:
#ifdef PANORAMIX
if
(
!
noPanoramiXExtension
)
return
ProcPanoramiXShmCreatePixmap
(
client
);
#endif
return
ProcShmCreatePixmap
(
client
);
default
:
return
BadRequest
;
}
}
/* A wrapper that handles the trap. This construct is used
to keep the derived code closer to the original
*/
static
int
ProcShmDispatch
(
register
ClientPtr
client
)
{
int
result
;
nxagentShmTrap
=
1
;
result
=
nxagent
_ProcShmDispatch
(
client
);
result
=
xorg
_ProcShmDispatch
(
client
);
nxagentShmTrap
=
0
;
...
...
@@ -564,55 +477,24 @@ ProcShmDispatch (register ClientPtr client)
}
static
int
SProcShmDispatch
(
client
)
register
ClientPtr
client
;
SProcShmDispatch
(
register
ClientPtr
client
)
{
REQUEST
(
xReq
)
;
int
result
;
#ifdef TEST
fprintf
(
stderr
,
"SProcShmDispatch: Going to execute operation [%d] for client [%d].
\n
"
,
stuff
->
data
,
client
->
index
);
#endif
switch
(
stuff
->
data
)
REQUEST
(
xReq
);
if
(
stuff
->
data
<=
X_ShmCreatePixmap
)
{
case
X_ShmQueryVersion
:
return
SProcShmQueryVersion
(
client
);
case
X_ShmAttach
:
return
SProcShmAttach
(
client
);
case
X_ShmDetach
:
return
SProcShmDetach
(
client
);
case
X_ShmPutImage
:
{
int
result
;
#ifdef TEST
fprintf
(
stderr
,
"SProcShmDispatch: Going to execute SProcShmPutImage() for client [%d].
\n
"
,
client
->
index
);
#endif
#ifdef NXAGENT_SERVER
nxagentShmTrap
=
1
;
#endif
fprintf
(
stderr
,
"SProcShmDispatch: Request [%s] OPCODE [%d] for client [%d].
\n
"
,
nxagentShmRequestLiteral
[
stuff
->
data
],
stuff
->
data
,
client
->
index
);
}
#endif
result
=
SProcShmPutImage
(
client
)
;
nxagentShmTrap
=
1
;
#ifdef NXAGENT_SERVER
nxagentShmTrap
=
0
;
#endif
result
=
xorg_SProcShmDispatch
(
client
);
#ifdef TEST
fprintf
(
stderr
,
"SProcShmDispatch: Returning from SProcShmPutImage() for client [%d].
\n
"
,
client
->
index
);
#endif
nxagentShmTrap
=
0
;
return
result
;
}
case
X_ShmGetImage
:
return
SProcShmGetImage
(
client
);
case
X_ShmCreatePixmap
:
return
SProcShmCreatePixmap
(
client
);
default
:
return
BadRequest
;
}
return
result
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment