On Wed, Sep 28, 2011 at 11:29:39PM +0200, Eduard Hasenleithner wrote:
> Here is some further thought about the pixmap handling. What I somehow
> dislike is the "dirty" handling of pixmaps when the client is closed.
> How about pre-allocating the pixmaps at driver startup:
>
> void wcmLedInitPixmap(WacomDevicePtr priv, int *values, int count)
> {
> int i;
> ScreenPtr pScreen = screenInfo.screens[0];
>
> for (i = 0; i < count; i++) {
> PixmapPtr pMap;
> XID id;
>
> pMap = pScreen->CreatePixmap(pScreen, 64, 32,
> pScreen->rootDepth, 0);
> id = FakeClientID(0);
> pMap->drawable.id = id;
> AddResource(id, RT_PIXMAP, pMap);
>
> values[i] = id;
> }
> }
>
> or is this also too "hackish"?
yes. Why do we have to worry about this?
Just make it a documented recommendation that any pixmap that is referenced
by the device must be persistent for the benefit of other clients and should
be overwritten, not replaced, whenever the image changes.
If a client screws up and frees the pixmap all that'll happen is that the
next client will get BadDrawable and can't read the current state of the
display and must create a new one. Not ideal but that's just a client bug.
Coincidentally, the code above would not work well with multiple
ScreenPtrs, iirc you'd have to allocate the pixmap on each screen.
Cheers,
Peter
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel