aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/extension.c2
-rw-r--r--xorg-server/dix/main.c2
-rw-r--r--xorg-server/dix/pixmap.c18
-rw-r--r--xorg-server/dix/registry.c94
-rw-r--r--xorg-server/dix/resource.c2
5 files changed, 79 insertions, 39 deletions
diff --git a/xorg-server/dix/extension.c b/xorg-server/dix/extension.c
index ede4bf5bd..e43291eec 100644
--- a/xorg-server/dix/extension.c
+++ b/xorg-server/dix/extension.c
@@ -139,7 +139,9 @@ AddExtension(const char *name, int NumEvents, int NumErrors,
ext->errorLast = 0;
}
+#ifdef X_REGISTRY_REQUEST
RegisterExtensionNames(ext);
+#endif
return ext;
}
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index 7427e08ca..930a85fb7 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -269,6 +269,8 @@ dix_main(int argc, char *argv[], char *envp[])
dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+ dixCloseRegistry();
+
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
if (!PanoramiXCreateConnectionBlock()) {
diff --git a/xorg-server/dix/pixmap.c b/xorg-server/dix/pixmap.c
index 4b880af58..00e298f5c 100644
--- a/xorg-server/dix/pixmap.c
+++ b/xorg-server/dix/pixmap.c
@@ -164,9 +164,9 @@ PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave)
}
Bool
-PixmapStartDirtyTracking(PixmapPtr src,
- PixmapPtr slave_dst,
- int x, int y)
+PixmapStartDirtyTracking2(PixmapPtr src,
+ PixmapPtr slave_dst,
+ int x, int y, int dst_x, int dst_y)
{
ScreenPtr screen = src->drawable.pScreen;
PixmapDirtyUpdatePtr dirty_update;
@@ -179,6 +179,8 @@ PixmapStartDirtyTracking(PixmapPtr src,
dirty_update->slave_dst = slave_dst;
dirty_update->x = x;
dirty_update->y = y;
+ dirty_update->dst_x = dst_x;
+ dirty_update->dst_y = dst_y;
dirty_update->damage = DamageCreate(NULL, NULL,
DamageReportNone,
@@ -195,6 +197,14 @@ PixmapStartDirtyTracking(PixmapPtr src,
}
Bool
+PixmapStartDirtyTracking(PixmapPtr src,
+ PixmapPtr slave_dst,
+ int x, int y)
+{
+ return PixmapStartDirtyTracking2(src, slave_dst, x, y, 0, 0);
+}
+
+Bool
PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
{
ScreenPtr screen = src->drawable.pScreen;
@@ -261,7 +271,7 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
h = dst_box.y2 - dst_box.y1;
pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC,
- dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dst_box.x1, dst_box.y1);
+ dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dirty->dst_x + dst_box.x1, dirty->dst_y + dst_box.y1);
b++;
}
FreeScratchGC(pGC);
diff --git a/xorg-server/dix/registry.c b/xorg-server/dix/registry.c
index 82a3340e1..84d48b4e3 100644
--- a/xorg-server/dix/registry.c
+++ b/xorg-server/dix/registry.c
@@ -21,8 +21,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <dix-config.h>
#endif
-#ifdef XREGISTRY
-
#include <stdlib.h>
#include <string.h>
#include <X11/X.h>
@@ -31,6 +29,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "registry.h"
#define BASE_SIZE 16
+
+#ifdef X_REGISTRY_REQUEST
#define CORE "X11"
#define FILENAME SERVER_MISC_CONFIG_PATH "/protocol.txt"
@@ -42,9 +42,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static FILE *fh;
static char ***requests, **events, **errors;
+static unsigned nmajor, *nminor, nevent, nerror;
+#endif
+
+#ifdef X_REGISTRY_RESOURCE
static const char **resources;
-static unsigned nmajor, *nminor, nevent, nerror, nresource;
+static unsigned nresource;
+#endif
+#if defined(X_REGISTRY_RESOURCE) || defined(X_REGISTRY_REQUEST)
/*
* File parsing routines
*/
@@ -72,7 +78,12 @@ double_size(void *p, unsigned n, unsigned size)
memset(*ptr + s, 0, f - s);
return TRUE;
}
+#endif
+#ifdef X_REGISTRY_REQUEST
+/*
+ * Request/event/error registry functions
+ */
static void
RegisterRequestName(unsigned major, unsigned minor, char *name)
{
@@ -197,28 +208,6 @@ RegisterExtensionNames(ExtensionEntry * extEntry)
}
}
-/*
- * Registration functions
- */
-
-void
-RegisterResourceName(RESTYPE resource, const char *name)
-{
- resource &= TypeMask;
-
- while (resource >= nresource) {
- if (!double_size(&resources, nresource, sizeof(char *)))
- return;
- nresource = nresource ? nresource * 2 : BASE_SIZE;
- }
-
- resources[resource] = name;
-}
-
-/*
- * Lookup functions
- */
-
const char *
LookupRequestName(int major, int minor)
{
@@ -269,6 +258,26 @@ LookupErrorName(int error)
return errors[error] ? errors[error] : XREGISTRY_UNKNOWN;
}
+#endif /* X_REGISTRY_REQUEST */
+
+#ifdef X_REGISTRY_RESOURCE
+/*
+ * Resource registry functions
+ */
+
+void
+RegisterResourceName(RESTYPE resource, const char *name)
+{
+ resource &= TypeMask;
+
+ while (resource >= nresource) {
+ if (!double_size(&resources, nresource, sizeof(char *)))
+ return;
+ nresource = nresource ? nresource * 2 : BASE_SIZE;
+ }
+
+ resources[resource] = name;
+}
const char *
LookupResourceName(RESTYPE resource)
@@ -279,10 +288,12 @@ LookupResourceName(RESTYPE resource)
return resources[resource] ? resources[resource] : XREGISTRY_UNKNOWN;
}
+#endif /* X_REGISTRY_RESOURCE */
void
dixFreeRegistry(void)
{
+#ifdef X_REGISTRY_REQUEST
/* Free all memory */
while (nmajor--) {
while (nminor[nmajor])
@@ -299,21 +310,30 @@ dixFreeRegistry(void)
while (nerror--)
free(errors[nerror]);
free(errors);
-
- free(resources);
-
requests = NULL;
nminor = NULL;
events = NULL;
errors = NULL;
- resources = NULL;
+ nmajor = nevent = nerror = 0;
+#endif
+
+#ifdef X_REGISTRY_RESOURCE
+ free(resources);
- nmajor = nevent = nerror = nresource = 0;
+ resources = NULL;
+ nresource = 0;
+#endif
+}
+void
+dixCloseRegistry(void)
+{
+#ifdef X_REGISTRY_REQUEST
if (fh) {
fclose(fh);
fh = NULL;
}
+#endif
}
/*
@@ -322,16 +342,24 @@ dixFreeRegistry(void)
void
dixResetRegistry(void)
{
+#ifdef X_REGISTRY_REQUEST
ExtensionEntry extEntry = { .name = CORE };
+#endif
dixFreeRegistry();
+#ifdef X_REGISTRY_REQUEST
/* Open the protocol file */
fh = fopen(FILENAME, "r");
if (!fh)
LogMessage(X_WARNING,
"Failed to open protocol names file " FILENAME "\n");
+ /* Add the core protocol */
+ RegisterExtensionNames(&extEntry);
+#endif
+
+#ifdef X_REGISTRY_RESOURCE
/* Add built-in resources */
RegisterResourceName(RT_NONE, "NONE");
RegisterResourceName(RT_WINDOW, "WINDOW");
@@ -343,9 +371,5 @@ dixResetRegistry(void)
RegisterResourceName(RT_CMAPENTRY, "COLORMAP ENTRY");
RegisterResourceName(RT_OTHERCLIENT, "OTHER CLIENT");
RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB");
-
- /* Add the core protocol */
- RegisterExtensionNames(&extEntry);
+#endif
}
-
-#endif /* XREGISTRY */
diff --git a/xorg-server/dix/resource.c b/xorg-server/dix/resource.c
index 623d862d6..c254244a3 100644
--- a/xorg-server/dix/resource.c
+++ b/xorg-server/dix/resource.c
@@ -524,8 +524,10 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name)
resourceTypes[next].findSubResFunc = DefaultFindSubRes;
resourceTypes[next].errorValue = BadValue;
+#if X_REGISTRY_RESOURCE
/* Called even if name is NULL, to remove any previous entry */
RegisterResourceName(next, name);
+#endif
return next;
}