are display driver functions in mirror driver called parallel or sequentially

Discussion in 'Windows Vista Drivers' started by lee, Sep 14, 2005.

  1. lee

    lee Guest

    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,
    lee, Sep 14, 2005
    1. Advertisements

  2. 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 ?
    Ivan Brugiolo [MSFT], Sep 15, 2005
    1. Advertisements

  3. lee

    Calvin Guan Guest

    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 [email protected]#$ PDEV. There is a nice doc describing
    different sync levels for each routine. I hope it had been formally put in
    Wdk doc.

    Calvin Guan, Sep 15, 2005
  4. lee

    Tim Roberts Guest

    GDI serializes calls into your driver. You don't have to worry about

    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, Sep 15, 2005
  5. 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"

    In LDDM, when you are running in non-composite mode,
    the PDEV is implemented by cdd.dll, that is a system supplied display
    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
    Ivan Brugiolo [MSFT], Sep 15, 2005
  6. lee

    lee Guest

    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,
    lee, Sep 16, 2005
  7. lee

    Skywing Guest

    Well, you could just make your own synchronization function that you call in
    each of driver callback routines.
    Skywing, Sep 16, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.