Graphics driver calling sequence

This is a general question about the calling sequence which Photon uses to
load and initialize the devg-* library. I’ve read the Graphics DDK docs,
and the sequence is pretty clearly explained. However, I’d like to know
where the dll loading functions are actually called (meaning all of the
devg_get_*funcs). Is it valid to call ALL of these before the module
initialization sequence, or should they be called during the module
initialization sequence? To further clarify what I’m asking, my specific
problem is below.

I’m working with a devg library which expects some context to be setup when
devg_get_corefuncs is called. Specifically, it expects some driver specific
data to already be loaded in the gd_ctx field of the passed disp_adapter_t
argument. Is this a valid way to do things? I would think that this driver
specific context would be setup in an init() call that is made AFTER all of
the module entrypoints are loaded.

Thanks for any feedback. I can continue this offline if that would help.

Charlie

Charlie Surface <charlie_surface@oti.com> wrote:

This is a general question about the calling sequence which Photon uses to
load and initialize the devg-* library. I’ve read the Graphics DDK docs,
and the sequence is pretty clearly explained. However, I’d like to know
where the dll loading functions are actually called (meaning all of the
devg_get_*funcs). Is it valid to call ALL of these before the module
initialization sequence, or should they be called during the module
initialization sequence? To further clarify what I’m asking, my specific
problem is below.

Unfortunately you can make no assumptions about the order in which the
devg_get_* functions will be called; they could be called at any time,
and in any order.

I’m working with a devg library which expects some context to be setup when
devg_get_corefuncs is called. Specifically, it expects some driver specific
data to already be loaded in the gd_ctx field of the passed disp_adapter_t
argument. Is this a valid way to do things? I would think that this driver
specific context would be setup in an init() call that is made AFTER all of
the module entrypoints are loaded.

You probably want to do such setup in one of the init routines. You can
do whatever you like with the *_ctx fields, since they’re for the drivers
use exclusively. However, for example, it would not be a good idea to
modify/use vid_ctx if your DLL did not include video overlay support.

So as long as you play within the constraints of the calling sequence for
the init routines, you should be OK.

Dave