We can now launch GL or XV apps in any of the
Xephyr screens we want.
* hw/kdrive/ephyr/hostx.c,h:
(hostx_get_window):
(hostx_create_window): make these functions be screen
number aware.
* hw/kdrive/ephyr/XF86dri.c : fix some compiler warnings.
* hw/kdrive/ephyr/ephyrdri.c:
(ephyrDRIQueryDirectRenderingCapable),
(ephyrDRIOpenConnection),
(ephyrDRIAuthConnection),
(ephyrDRICloseConnection),
(ephyrDRIGetClientDriverName),
(ephyrDRICreateContext),
(ephyrDRIDestroyContext),
(ephyrDRICreateDrawable),
(ephyrDRIGetDrawableInfo),
(ephyrDRIGetDeviceInfo): in all those functions, don't forward
the screen number we receive - from the client - to the host X.
We (Xephyr) are always targetting the same X display screen, which is
the one Xephyr got launched against. So we enforce that in the code.
* hw/kdrive/ephyr/ephyrdriext.c:
(EphyrMirrorHostVisuals): make this duplicate the visuals of the host X
default screen into a given Xephyr screen. This way we have a chance
to update the visuals of all Xephyr screen to make them mirror those
of the host X.
(many other places): specify screen number where required by the api
change in hostx.h.
* hw/kdrive/ephyr/ephyrglxext.c: specify screen number where required
by the api change in hostx.h
* hw/kdrive/ephyr/ephyrhostglx.c: don't forward the screen number we
receive - from the client - to the host X.
We (Xephyr) are always targetting the same
X display screen, which is
the one Xephyr got launched against. So we enforce that in the code.
* hw/kdrive/ephyr/ephyrhostvideo.c,h: take in account the screen number received
from the client app. This is useful to know on which Xephyr screen we
need to display video stuff.
* hw/kdrive/ephyr/ephyrvideo.c: update this to reflect the API change
in hw/kdrive/ephyr/ephyrhostvideo.h.
(ephyrSetPortAttribute): when parameters are not valid
- they exceed their validity range - send them to the host anyway
and do not return an error to clients.
Some host expose buggy validity range, so rejecting client for that
is too harsh.
* hw/kdrive/ephyr/ephyrhostvideo.c/h:
(ephyrHostXVStopVideo): add this entry point.
* hw/kdrive/ephyr/ephyrvideo.c:
Basically add ReputImage and StopVideo implementations.
Now, when other windows obscur the video window, the reclipping
seems to be well handled using StopVideo and ReputImage.
To do this, I was obliged to save the frame in PutImage, so
that I could resend it un ReputImage.
* hw/kdrive/ephyr/ephyrhostvideo.c,h:
(ephyrHostXVPutImage): make this support clipping region.
The clipping region is propagated to host using XSetClipRectangles.
This changes the API of ephyrHostXVPutImage.
* hw/kdrive/ephyr/ephyrvideo.c:
(ephyrPutImage): propagate the clipping region to the new
ephyrHostXVPutImage() entry point.
* hw/kdrive/ephyr/ephyrhostvideo.c,h:
(ephyrHostXVAdaptorHasPutVideo): detect if
host X has the PutVideo call.
(ephyrHostXVAdaptorHasPutStill): detect if
host X has the PutStill call
(ephyrHostXVAdaptorHasPutImage): detect if
host X has the PutImage call
* hw/kdrive/ephyr/ephyrvideo.c:
(ephyrXVPrivQueryHostAdaptors): make sure to create
atoms for attribute names otherwise subsequent
calls to get/set attribute from clients won't work.
(ephyrXVPrivSetAdaptorsHooks): don't hardwire advertising
of the PutImage call. Instead, advertise the calls advertised
by the host.
* hw/kdrive/ephyr/ephyrhostvideo.c,h:
(ephyrHostXVLogXErrorEvent): add this to
log X error events. Heavily copied from libx11
(ephyrHostXVErrorHandler): new x error handler that
logs the error but does not exits.
(ephyrHostXVInit): add this to be called at the beginning
of xvideo lifetime. It sets an xerror handler that does not
exit.
* hw/kdrive/ephyr/ephyrvideo.c:
(ephyrXVPrivIsAttrValueValid): this validates an attribute
value.
(ephyrSetPortAttribute): before setting an attribute,
validate the new value so that we don't send a buggy
request to host X.
* hw/kdrive/ephyr/*.c: fix case in ephyrvideo code.
* hw/kdrive/ephyr/ephyr.c: fix a typo
* hw/kdrive/ephyr/ephyrhostvideo.c,h:
(EphyrHostXVPutImage): first implementation. does not
support clipping regions yet.
* hw/kdrive/ephyr/ephyrvideo.c:
(DoSimpleClip): clip using a clipping box. Does not
support regions yet.
(EphyrPutImage): first implementation.
Uses a simple clipping rectangle, no region yet.
* hw/kdrive/ephyr/hostx.c:
(hostx_get_window): added this to get the main
window of the host x.
* hw/kdrive/ephyr/ephyrhostvideo.c,h:
(EphyrHostXVQueryImageAttributes): add this call. It calls
XvQueryBestSize xserver entry point. It uses the protocol
level machinery because Xvlib does not expose that entry point
as a C function.
(EphyrHostXVQueryBestSize): added this wrapper around XvQueryBestSize().
(EphyrHostGetAtom, EphyrHostGetAtomName): added this to get
an atom or atom name from the host server
* hw/kdrive/ephyr/ephyrvideo.c:
(EphyrSetPortAttribute): convert the atom into an host server
server atom before attacking the host server with it, because in
in its current form, the input atom is only valid in xephyr.
This fix makes this call work.
(EphyrGetPortAttribute): ditto.
(EphyrQueryBestSize): implement this.
(EphyrQueryImageAttributes): implement this.
* hw/kdrive/ephyr/ephyrhostvideo.c:
(EphyrHostXVAdaptorGetVideoFormats): properly get visual class instead of
returning the visual id.
(EphyrHostXVQueryEncodings): properly copy the fields because simple casting does
truncate some fields.
(EphyrHostAttributesDelete): XFree the whole array instead of trying to free invidial members.
* hw/kdrive/ephyr/ephyrvideo.c:
(ephyrInitVideo): fix a typo
(EphyrXVPrivQueryHostAdaptors): set XvWindowMask mask to adaptors type.
use host adaptor name. Don't forget to set nImages field.
(EphyrXVPrivRegisterAdaptors): report an error when KdXVScreenInit() fails.