Tech Support > Microsoft Windows > Drivers > are display driver functions in mirror driver called parallel or sequentially
are display driver functions in mirror driver called parallel or sequentially
Posted by lee on September 14th, 2005


I'm writing a mirror driver. for each display driver function in the
mirror driver, the function puts some information into a common system
buffer. an application in user mode may retrieve the information from
the buffer. My question is whether Graphics Engine GDI calls these
display driver functions sequentially or parallel? If Graphics Engine
calls display driver functions parallel, I need to add sychronization
mechanism so that the display driver functions would not write the
common buffer at same time.

Does any Guru know it, please kindly tell me.

Thanks so much,

Posted by Ivan Brugiolo [MSFT] on September 15th, 2005


The current implementation ensures that at least
a lock that is created for each PDEV it taken before the DDI cal is entered.
This is normally done to protect the display driver from mode-changes
and/or desktop switches.
Depending on the operation, other locks mayhave been taken.
On average, you can use `!locks` in KD to ensure that, given the
fact that current implementation uses ERESOURCE to synchronize things.

I guess yor problem is to synchronize the application that fetches data
from the display driver with the drawing operations.
How does your application access the mirror display driver ?

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"lee" <lander_gao@yahoo.com> wrote in message
news:1126715225.016851.113050@g14g2000cwa.googlegr oups.com...


Posted by Calvin Guan on September 15th, 2005


Ivan, I beg your pardon.

DrvEscape is not sync with other rendering DrvXxx even for a PDEV, at least
for xpsp2. I remembered fighting this when I was at ATI. LDDM change that a
lot since there is no more !@#$ PDEV. There is a nice doc describing
different sync levels for each routine. I hope it had been formally put in
Wdk doc.

Calvin

--
Calvin Guan (Windows DDK MVP)
NetXtreme Longhorn Miniport Prime
Broadcom Corp. www.broadcom.com

"Ivan Brugiolo [MSFT]" <Ivan.Brugiolo@online.microsoft.com> wrote in message
news:uW42R0auFHA.3932@TK2MSFTNGP15.phx.gbl...


Posted by Tim Roberts on September 15th, 2005


"lee" <lander_gao@yahoo.com> wrote:
GDI serializes calls into your driver. You don't have to worry about
synchronization.

There are some considerations if you have a blitter that continues to run
after you return, but in your case, since you don't have hardware, that
isn't a problem.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Posted by Ivan Brugiolo [MSFT] on September 15th, 2005


You are most definitely right.
A complete answer would need to go through each of the 90-something
functions that
a display driver can possibly implement, and, I gave an answer for
what I normally consider the "drawing" DDI functions.
DrvEscape does not hold PDEV lock, and, in my mind, it is not a "drawing"
call.

In LDDM, when you are running in non-composite mode,
the PDEV is implemented by cdd.dll, that is a system supplied display
driver.
That one is still used for mode changes, and for desktop switches.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Calvin Guan" <hguan@nospam.broadcom.com> wrote in message
news:%236UsiibuFHA.596@TK2MSFTNGP12.phx.gbl...


Posted by lee on September 16th, 2005


Thank all of you so much for telling it. If I understood correctly, all
the "drawing" DDI functions would be called sequentially, but it won't
be the case for DrvEscape function. I did write DrvEscape function so
that Mirror driver may share the system buffer with the application.
Now I think that I have to synchronize the application that retrives
drawing information from the buffer.

Would you experts please to give me any clue or direction how to
synchronize DrvEscape function with other "drawing" functions?

Thanks so much,


Ivan Brugiolo [MSFT] wrote:

Posted by Skywing on September 16th, 2005


Well, you could just make your own synchronization function that you call in
each of driver callback routines.

"lee" <lander_gao@yahoo.com> wrote in message
news:1126895950.655273.233810@z14g2000cwz.googlegr oups.com...