egl: s/EGL_DISPLAY/EGL_PLATFORM/.

A platform is already used to mean a window system in EGL.  No need to
use a different term.
This commit is contained in:
Chia-I Wu
2010-06-17 16:07:46 +08:00
parent 6f690caddc
commit da39d5d3b4
8 changed files with 64 additions and 57 deletions

View File

@@ -97,7 +97,7 @@ GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive
# Driver specific build vars # Driver specific build vars
DRI_DIRS = @DRI_DIRS@ DRI_DIRS = @DRI_DIRS@
EGL_DISPLAYS = @EGL_DISPLAYS@ EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@ EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies # Dependencies

View File

@@ -110,8 +110,8 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib GALLIUM_TARGET_DIRS = libgl-xlib
GALLIUM_STATE_TRACKERS_DIRS = glx vega GALLIUM_STATE_TRACKERS_DIRS = glx vega
# native displays EGL should support # native platforms EGL should support
EGL_DISPLAYS = x11 EGL_PLATFORMS = x11
EGL_CLIENT_APIS = $(GL_LIB) EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies # Library dependencies

View File

@@ -1301,18 +1301,22 @@ if test "x$HAVE_ST_XORG" = xyes; then
HAVE_XEXTPROTO_71="no") HAVE_XEXTPROTO_71="no")
fi fi
AC_ARG_WITH([egl-platforms],
[AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
[comma delimited native platforms libEGL supports, e.g.
"x11,kms" @<:@default=auto@:>@])],
[with_egl_platforms="$withval"],
[with_egl_platforms=yes])
AC_ARG_WITH([egl-displays], AC_ARG_WITH([egl-displays],
[AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@], [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
[comma delimited native displays libEGL supports, e.g. [DEPRECATED. Use --with-egl-platforms instead])],
"x11,kms" @<:@default=auto@:>@])], [with_egl_platforms="$withval"])
[with_egl_displays="$withval"],
[with_egl_displays=yes])
EGL_DISPLAYS="" EGL_PLATFORMS=""
case "$with_egl_displays" in case "$with_egl_platforms" in
yes) yes)
if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
EGL_DISPLAYS="x11" EGL_PLATFORMS="x11"
fi fi
;; ;;
*) *)
@@ -1320,18 +1324,18 @@ yes)
AC_MSG_ERROR([cannot build egl state tracker without EGL library]) AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi fi
# verify the requested driver directories exist # verify the requested driver directories exist
egl_displays=`IFS=', '; echo $with_egl_displays` egl_platforms=`IFS=', '; echo $with_egl_platforms`
for dpy in $egl_displays; do for plat in $egl_platforms; do
test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \ test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
AC_MSG_ERROR([EGL display '$dpy' does't exist]) AC_MSG_ERROR([EGL platform '$plat' does't exist])
if test "$dpy" = "fbdev"; then if test "$plat" = "fbdev"; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev" GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
fi fi
done done
EGL_DISPLAYS="$egl_displays" EGL_PLATFORMS="$egl_platforms"
;; ;;
esac esac
AC_SUBST([EGL_DISPLAYS]) AC_SUBST([EGL_PLATFORMS])
AC_ARG_WITH([egl-driver-dir], AC_ARG_WITH([egl-driver-dir],
[AS_HELP_STRING([--with-egl-driver-dir=DIR], [AS_HELP_STRING([--with-egl-driver-dir=DIR],
@@ -1579,7 +1583,7 @@ echo " Shared libs: $enable_shared"
echo " Static libs: $enable_static" echo " Static libs: $enable_static"
if test "$enable_egl" = yes; then if test "$enable_egl" = yes; then
echo " EGL: $EGL_DRIVERS_DIRS" echo " EGL: $EGL_DRIVERS_DIRS"
echo " EGL displays: $EGL_DISPLAYS" echo " EGL platforms: $EGL_PLATFORMS"
else else
echo " EGL: no" echo " EGL: no"
fi fi

View File

@@ -69,17 +69,17 @@ drivers will be installed to <code>${libdir}/egl</code>.</p>
</li> </li>
<li><code>--with-egl-displays</code> <li><code>--with-egl-platforms</code>
<p>List the window system(s) to support. It is by default <code>x11</code>, <p>List the native platform window system(s) to support. It is by default
which supports the X Window System. Its argument is a comma separated string <code>x11</code>, which supports the X Window System. Its argument is a comma
like, for example, <code>--with-egl-displays=x11,kms</code>. Because an EGL separated string like, for example, <code>--with-egl-platforms=x11,kms</code>.
driver decides which window system to support, this example will enable two Because an EGL driver decides which window system to support, this example will
(sets of) EGL drivers. One supports the X window system and the other supports enable two (sets of) EGL drivers. One supports the X window system and the
bare KMS (kernel modesetting).</p> other supports bare KMS (kernel modesetting).</p>
<p>The available displays are <code>x11</code>, <code>kms</code>, <p>The available platforms are <code>x11</code>, <code>kms</code>,
<code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> display can <code>fbdev</code>, and <code>gdi</code>. The <code>gdi</code> platform can
only be built with SCons.</p> only be built with SCons.</p>
</li> </li>
@@ -151,14 +151,14 @@ specific driver. This variable is ignored for setuid/setgid binaries.</p>
</li> </li>
<li><code>EGL_DISPLAY</code> <li><code>EGL_PLATFORM</code>
<p>When <code>EGL_DRIVER</code> is not set, the main library loads <em>all</em> <p>When <code>EGL_DRIVER</code> is not set, the main library loads <em>all</em>
EGL drivers that support a certain window system. <code>EGL_DISPLAY</code> can EGL drivers that support a certain window system. <code>EGL_PLATFORM</code>
be used to specify the window system and the valid values are, for example, can be used to specify the window system and the valid values are, for example,
<code>x11</code> or <code>kms</code>. When the variable is not set, the main <code>x11</code> or <code>kms</code>. When the variable is not set, the main
library defaults the value to the first window system listed in library defaults the value to the first window system listed in
<code>--with-egl-displays</code> at configuration time. <code>--with-egl-platforms</code> at configuration time.
</li> </li>
@@ -195,9 +195,9 @@ drivers are</p>
<li><code>egl_&lt;dpy&gt;_vmwgfx</code></li> <li><code>egl_&lt;dpy&gt;_vmwgfx</code></li>
</ul> </ul>
<p><code>&lt;dpy&gt;</code> is given by <code>--with-egl-displays</code> at <p><code>&lt;dpy&gt;</code> is given by <code>--with-egl-platforms</code> at
configuration time. There is usually one EGL driver for each combination of configuration time. There is usually one EGL driver for each combination of
the displays listed and the pipe drivers enabled. When the display is pure the platforms listed and the pipe drivers enabled. When the platform is pure
software or pure hardware, non-working combinations will not be built.</p> software or pure hardware, non-working combinations will not be built.</p>
<p>Classic EGL drivers, on the other hand, support only a subset of the <p>Classic EGL drivers, on the other hand, support only a subset of the
@@ -322,7 +322,7 @@ should as well lock the display before using it.
<ul> <ul>
<li>Pass the conformance tests</li> <li>Pass the conformance tests</li>
<li>Better automatic driver selection: <code>EGL_DISPLAY</code> loads all <li>Better automatic driver selection: <code>EGL_PLATFORM</code> loads all
drivers and might eat too much memory.</li> drivers and might eat too much memory.</li>
</ul> </ul>

View File

@@ -7,7 +7,7 @@ include $(TOP)/configs/current
EGL_MAJOR = 1 EGL_MAJOR = 1
EGL_MINOR = 0 EGL_MINOR = 0
INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS) INCLUDE_DIRS = -I$(TOP)/include
HEADERS = \ HEADERS = \
eglcompiler.h \ eglcompiler.h \
@@ -51,10 +51,10 @@ OBJECTS = $(SOURCES:.c=.o)
# use dl*() to load drivers # use dl*() to load drivers
LOCAL_CFLAGS = -D_EGL_OS_UNIX=1 LOCAL_CFLAGS = -D_EGL_OS_UNIX=1
EGL_DEFAULT_DISPLAY = $(word 1, $(EGL_DISPLAYS)) EGL_DEFAULT_PLATFORM = $(firstword $(EGL_PLATFORMS))
LOCAL_CFLAGS += \ LOCAL_CFLAGS += \
-D_EGL_DEFAULT_DISPLAY=\"$(EGL_DEFAULT_DISPLAY)\" \ -D_EGL_DEFAULT_PLATFORM=\"$(EGL_DEFAULT_PLATFORM)\" \
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" -D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\"
.c.o: .c.o:

View File

@@ -464,24 +464,27 @@ _eglPreloadUserDriver(void)
/** /**
* Preload display drivers. * Preload platform drivers.
* *
* Display drivers are a set of drivers that support a certain display system. * Platform drivers are a set of drivers that support a certain window system.
* The display system may be specified by EGL_DISPLAY. * The window system may be specified by EGL_PLATFORM.
* *
* FIXME This makes libEGL a memory hog if an user driver is not specified and * FIXME This makes libEGL a memory hog if an user driver is not specified and
* there are many display drivers. * there are many platform drivers.
*/ */
static EGLBoolean static EGLBoolean
_eglPreloadDisplayDrivers(void) _eglPreloadPlatformDrivers(void)
{ {
const char *dpy; const char *dpy;
char prefix[32]; char prefix[32];
int ret; int ret;
dpy = getenv("EGL_DISPLAY"); dpy = getenv("EGL_PLATFORM");
/* try deprecated env variable */
if (!dpy || !dpy[0]) if (!dpy || !dpy[0])
dpy = _EGL_DEFAULT_DISPLAY; dpy = getenv("EGL_DISPLAY");
if (!dpy || !dpy[0])
dpy = _EGL_DEFAULT_PLATFORM;
if (!dpy || !dpy[0]) if (!dpy || !dpy[0])
return EGL_FALSE; return EGL_FALSE;
@@ -515,7 +518,7 @@ _eglPreloadDrivers(void)
} }
loaded = (_eglPreloadUserDriver() || loaded = (_eglPreloadUserDriver() ||
_eglPreloadDisplayDrivers()); _eglPreloadPlatformDrivers());
_eglUnlockMutex(_eglGlobal.Mutex); _eglUnlockMutex(_eglGlobal.Mutex);

View File

@@ -42,9 +42,9 @@ ALL_OBJECTS = $(common_OBJECTS) $(x11_OBJECTS) $(kms_OBJECTS) $(fbdev_OBJECTS)
##### TARGETS ##### ##### TARGETS #####
EGL_DISPLAYS_MODS = $(foreach dpy, $(EGL_DISPLAYS), libegl$(dpy).a) EGL_PLATFORMS_MODS = $(foreach plat, $(EGL_PLATFORMS), libegl$(plat).a)
default: depend $(EGL_DISPLAYS_MODS) default: depend $(EGL_PLATFORMS_MODS)
libeglx11.a: $(x11_OBJECTS) $(common_OBJECTS) Makefile libeglx11.a: $(x11_OBJECTS) $(common_OBJECTS) Makefile
@@ -63,7 +63,7 @@ depend:
clean: clean:
rm -f $(ALL_OBJECTS) rm -f $(ALL_OBJECTS)
rm -f $(EGL_DISPLAYS_MODS) rm -f $(EGL_PLATFORMS_MODS)
rm -f depend depend.bak rm -f depend depend.bak
# Dummy target # Dummy target

View File

@@ -63,18 +63,18 @@ INCLUDES = \
##### TARGETS ##### ##### TARGETS #####
ifeq ($(EGL_DRIVER_NAME),swrast) ifeq ($(EGL_DRIVER_NAME),swrast)
EGL_DISPLAYS := $(filter-out kms, $(EGL_DISPLAYS)) EGL_PLATFORMS := $(filter-out kms, $(EGL_PLATFORMS))
else else
EGL_DISPLAYS := $(filter-out fbdev, $(EGL_DISPLAYS)) EGL_PLATFORMS := $(filter-out fbdev, $(EGL_PLATFORMS))
endif endif
EGL_DISPLAY_DRIVERS = $(foreach dpy, $(EGL_DISPLAYS), egl_$(dpy)_$(EGL_DRIVER_NAME).so) EGL_PLATFORM_DRIVERS = $(foreach plat, $(EGL_PLATFORMS), egl_$(plat)_$(EGL_DRIVER_NAME).so)
EGL_DISPLAY_LIBS = $(foreach drv, $(EGL_DISPLAY_DRIVERS), $(TOP)/$(LIB_DIR)/egl/$(drv)) EGL_PLATFORM_LIBS = $(foreach drv, $(EGL_PLATFORM_DRIVERS), $(TOP)/$(LIB_DIR)/egl/$(drv))
default: $(EGL_DISPLAY_LIBS) default: $(EGL_PLATFORM_LIBS)
$(EGL_DISPLAY_LIBS): $(TOP)/$(LIB_DIR)/egl/%.so: %.so $(EGL_PLATFORM_LIBS): $(TOP)/$(LIB_DIR)/egl/%.so: %.so
@$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl @$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl
$(INSTALL) $< $(TOP)/$(LIB_DIR)/egl $(INSTALL) $< $(TOP)/$(LIB_DIR)/egl
@@ -97,11 +97,11 @@ egl_fbdev_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(fbdev_ST) $(EGL_DRIVER_
clean: clean:
-rm -f $(EGL_DRIVER_OBJECTS) -rm -f $(EGL_DRIVER_OBJECTS)
-rm -f $(EGL_DISPLAY_DRIVERS) -rm -f $(EGL_PLATFORM_DRIVERS)
install: $(EGL_DISPLAY_LIBS) install: $(EGL_PLATFORM_LIBS)
$(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR) $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
for lib in $(EGL_DISPLAY_LIBS); do \ for lib in $(EGL_PLATFORM_LIBS); do \
$(MINSTALL) -m 755 "$$lib" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \ $(MINSTALL) -m 755 "$$lib" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
done done