Can't change display modes

I have written a display driver (first time), and I’m trying to change the
screen resolution. I’m using EnumDisplaySettings to get the modes, and
setting a mode via the ChangeDisplaySettingsEx call. The EnumDisplaySettings
return my various defined modes (I see my DrvGetModes function getting
called), but when I call ChangeDisplaySettingsEx it returns a -1
(DISP_CHANGE_FAILED). I do a CDS_TEST to see if I can set the mode first
before I actually set it. But no matter what flag I put on the
ChangeDisplaySettingsEx call I get the DISP_CHANGE_FAILED failure.

What should I be looking for in my display driver, i.e. what callback
function should I have?

Thanks,
Rick

Try having a look at AssertMode, EnablePDEV and DisablePDEV. EnableSurface
and DisabelSurface might also be relevant.

Also, I’d have lots of printouts at every entry-point in the driver.

I think you’ll find that the Miniport has to be loaded correctly as well,
assuming you’re actually supporting real HW rather than some virtual
device.


Mats

xxxxx@lists.osr.com wrote on 10/15/2004 11:14:56 PM:

I have written a display driver (first time), and I’m trying to change
the
screen resolution. I’m using EnumDisplaySettings to get the modes, and
setting a mode via the ChangeDisplaySettingsEx call. The
EnumDisplaySettings
return my various defined modes (I see my DrvGetModes function getting
called), but when I call ChangeDisplaySettingsEx it returns a -1
(DISP_CHANGE_FAILED). I do a CDS_TEST to see if I can set the mode first
before I actually set it. But no matter what flag I put on the
ChangeDisplaySettingsEx call I get the DISP_CHANGE_FAILED failure.

What should I be looking for in my display driver, i.e. what callback
function should I have?

Thanks,
Rick


Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

ForwardSourceID:NT0000578E

Mats,

I do have printouts at the routines you mentioned. However, after the
initial call at boot time I do not get called at any of them again. That is
when I call ChangeDisplaySettingsEx I assume I should get called at
DisableSurface, DisablePDEV, then called at EnablePDEV, EnableSurface. I’m
not being called at any of them.

Is there anything else to look at? When you say the Miniport needs to be
loaded correctly what should I look for there?

Thanks,
Rick

“Mats PETERSSON” wrote in message
news:xxxxx@ntdev…
>
>
>
>
>
> Try having a look at AssertMode, EnablePDEV and DisablePDEV. EnableSurface
> and DisabelSurface might also be relevant.
>
> Also, I’d have lots of printouts at every entry-point in the driver.
>
> I think you’ll find that the Miniport has to be loaded correctly as well,
> assuming you’re actually supporting real HW rather than some virtual
> device.
>
> –
> Mats
>
> xxxxx@lists.osr.com wrote on 10/15/2004 11:14:56 PM:
>
> > I have written a display driver (first time), and I’m trying to change
> the
> > screen resolution. I’m using EnumDisplaySettings to get the modes, and
> > setting a mode via the ChangeDisplaySettingsEx call. The
> EnumDisplaySettings
> > return my various defined modes (I see my DrvGetModes function getting
> > called), but when I call ChangeDisplaySettingsEx it returns a -1
> > (DISP_CHANGE_FAILED). I do a CDS_TEST to see if I can set the mode first
> > before I actually set it. But no matter what flag I put on the
> > ChangeDisplaySettingsEx call I get the DISP_CHANGE_FAILED failure.
> >
> >
> >
> > What should I be looking for in my display driver, i.e. what callback
> > function should I have?
> >
> > Thanks,
> > Rick
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at http://www.
> > osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> > ForwardSourceID:NT0000578E
>
>
>

Rick,

Do you have a miniport for your device, or do you not need one? (I’m unsure
of what cases one would definitely need one and when not, but I expect
something like a mirror driver would be a NOT case).

If you have a miniport for your device, you should at the very least see a
call (at start of day) for “DriverEntry”. That will later on call the
call-backs reported in DriverEntry: hwFindAdapter & hwInitializeAdapter.

You could also be interested in seeing your Miniport’s IOCTL calls, and see
if any of those turn our funny, for example
IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES and IOCTL_VIDEO_QUERY_AVAIL_MODES and
IOCTL_VIDEO_SET_CURRENT_MODE.

The IOCTL processing is also set up in the DriverEntry function.
(hwProcessIOCTL, I think).

I’m sorry if this is a bit too basic.

Alternatively, figure out where your ChangeDisplaySettings end up in GDI
(or wherever it goes) and follow it into your driver (or wherever it takes
you), and then figure out why and what you have to do to make it work…
It’s usually pretty trivial.

By the way, can’t you use the Control Panel to change mode? Just to rule
out any bugs in the ChangeDisplaySettings call…


Mats

xxxxx@lists.osr.com wrote on 10/18/2004 12:33:33 PM:

Mats,

I do have printouts at the routines you mentioned. However, after the
initial call at boot time I do not get called at any of them again. That
is
when I call ChangeDisplaySettingsEx I assume I should get called at
DisableSurface, DisablePDEV, then called at EnablePDEV, EnableSurface.
I’m
not being called at any of them.

Is there anything else to look at? When you say the Miniport needs to be
loaded correctly what should I look for there?

Thanks,
Rick

“Mats PETERSSON” wrote in message
> news:xxxxx@ntdev…
> >
> >
> >
> >
> >
> > Try having a look at AssertMode, EnablePDEV and DisablePDEV.
EnableSurface
> > and DisabelSurface might also be relevant.
> >
> > Also, I’d have lots of printouts at every entry-point in the driver.
> >
> > I think you’ll find that the Miniport has to be loaded correctly as
well,
> > assuming you’re actually supporting real HW rather than some virtual
> > device.
> >
> > –
> > Mats
> >
> > xxxxx@lists.osr.com wrote on 10/15/2004 11:14:56 PM:
> >
> > > I have written a display driver (first time), and I’m trying to
change
> > the
> > > screen resolution. I’m using EnumDisplaySettings to get the modes,
and
> > > setting a mode via the ChangeDisplaySettingsEx call. The
> > EnumDisplaySettings
> > > return my various defined modes (I see my DrvGetModes function
getting
> > > called), but when I call ChangeDisplaySettingsEx it returns a -1
> > > (DISP_CHANGE_FAILED). I do a CDS_TEST to see if I can set the mode
first
> > > before I actually set it. But no matter what flag I put on the
> > > ChangeDisplaySettingsEx call I get the DISP_CHANGE_FAILED failure.
> > >
> > >
> > >
> > > What should I be looking for in my display driver, i.e. what callback
> > > function should I have?
> > >
> > > Thanks,
> > > Rick
> > >
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at http://www.
> > > osronline.com/article.cfm?id=256
> > >
> > > You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> > > To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> > > ForwardSourceID:NT0000578E
> >
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.
> osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@3dlabs.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

> ForwardSourceID:NT0000587E