Rotation support in display driver

Hi,

I am trying to add rotation support in my display driver. The driver is
for Windows XP. I have tried setting the DM_DISPLAYORIENTATION flag in
the dmFields member of the DEVMODEW structure and setting
dmDisplayOrientation to DMDO_180. After this I tried calling
ChangeDisplaySettings with setting dmDisplayOrientation. But this did
not work.

I don’t have a clear idea of exactly how to do this. If any one can
guide me that would be great.

Thanks
Mudeem

Some information that I forgot to mention, this is a virtual display
driver. I have punted all the functionality to the GDI layer including
blt’s. I am hoping that GDI can take care of the rotation as well. I my
assumption correct. or does the display driver has to take care of the
rotation itself.

Mudeem

Hi,

I am trying to add rotation support in my display driver. The driver is
for Windows XP. I have tried setting the DM_DISPLAYORIENTATION flag in
the dmFields member of the DEVMODEW structure and setting
dmDisplayOrientation to DMDO_180. After this I tried calling
ChangeDisplaySettings with setting dmDisplayOrientation. But this did
not work.

I don’t have a clear idea of exactly how to do this. If any one can
guide me that would be great.

Thanks
Mudeem


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

mudeem wrote:

Hi,

I am trying to add rotation support in my display driver. The driver
is for Windows XP. I have tried setting the DM_DISPLAYORIENTATION flag
in the dmFields member of the DEVMODEW structure and setting
dmDisplayOrientation to DMDO_180. After this I tried calling
ChangeDisplaySettings with setting dmDisplayOrientation. But this did
not work.

As far as I know, that option is only available in Windows CE. Further,
all that does is request rotation. It’s up to the driver to actually
implement it.

I don’t have a clear idea of exactly how to do this. If any one can
guide me that would be great.

Unless your graphics chip actually supports rotation in hardware, this
is a rather difficult task. If you are willing to give up hardware
acceleration, you can punt all of the drawing back to GDI in the rotated
modes.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Mudeem Iqbal wrote:

Some information that I forgot to mention, this is a virtual display
driver. I have punted all the functionality to the GDI layer including
blt’s. I am hoping that GDI can take care of the rotation as well. I
my assumption correct. or does the display driver has to take care of
the rotation itself.

No, GDI doesn’t take care of this automatically. At some point (probably
DrvCopyBits), you are going to have to rotate the bitmap and copy it out
to your frame buffer.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

So how does the driver advertise that it supports rotation and how does
GDI tell the DDI that it has to rotate the frame buffer.

Thanks
Mudeem

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Friday, October 20, 2006 12:00 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Rotation support in display driver

Mudeem Iqbal wrote:

Some information that I forgot to mention, this is a virtual display
driver. I have punted all the functionality to the GDI layer including
blt’s. I am hoping that GDI can take care of the rotation as well. I
my assumption correct. or does the display driver has to take care of
the rotation itself.

No, GDI doesn’t take care of this automatically. At some point (probably
DrvCopyBits), you are going to have to rotate the bitmap and copy it out
to your frame buffer.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Mudeem Iqbal wrote:

So how does the driver advertise that it supports rotation and how does
GDI tell the DDI that it has to rotate the frame buffer.

There is no advertised attribute for rotation. You have to have some
private mechanism that your driver understands. For 90 and 270 degrees,
you might offer a resolution of 768x1024 instead of 1024x768. For 180,
you might have some private registry setting, or maybe trigger it with
an escape. GDI won’t know about it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

OP, you will have to make a private escape call to invoke the rotation,
exactly like what Tim is suggesting. If you have a ATI radeon graphics,
download their desktop management s/w to get a feel how they do it.

The miniport driver has rebuild the mode table and add the rotated
resolutions when responds to a “query modes” IOCTL (can’t remember the
exact name).

If your hw can’t do acceleration on rotation, that’s gonna to be very
slow.

Calvin Guan (DDK MVP)
Sr. Staff engineer
NetXtreme Vista/LH Server Miniport
Broadcom Corporation
Connecting Everything(r)

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-267304-
xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Friday, October 20, 2006 3:05 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Rotation support in display driver

Mudeem Iqbal wrote:

>So how does the driver advertise that it supports rotation and how
does
>GDI tell the DDI that it has to rotate the frame buffer.
>
>

There is no advertised attribute for rotation. You have to have some
private mechanism that your driver understands. For 90 and 270
degrees,
you might offer a resolution of 768x1024 instead of 1024x768. For
180,
you might have some private registry setting, or maybe trigger it with
an escape. GDI won’t know about it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

hi,

there is no need for the driver to tell it supports rotation.

also there is no need to tell to GDI that rotation has to be performed.

Here you can use filter display driver, that will sit between actual display
driver and GDI.

Bye.
----- Original Message -----
From: “Mudeem Iqbal”
To: “Windows System Software Devs Interest List”
Sent: Saturday, October 21, 2006 1:14 AM
Subject: RE: [ntdev] Rotation support in display driver

So how does the driver advertise that it supports rotation and how does
GDI tell the DDI that it has to rotate the frame buffer.

Thanks
Mudeem

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Friday, October 20, 2006 12:00 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Rotation support in display driver

Mudeem Iqbal wrote:

> Some information that I forgot to mention, this is a virtual display
> driver. I have punted all the functionality to the GDI layer including
> blt’s. I am hoping that GDI can take care of the rotation as well. I
> my assumption correct. or does the display driver has to take care of
> the rotation itself.
>

No, GDI doesn’t take care of this automatically. At some point (probably
DrvCopyBits), you are going to have to rotate the bitmap and copy it out
to your frame buffer.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

anshul makkar wrote:

there is no need for the driver to tell it supports rotation.

also there is no need to tell to GDI that rotation has to be performed.

Here you can use filter display driver, that will sit between actual
display driver and GDI.

You say that as if it were easy. It isn’t. There is no official
mechanism for writing and installing a GDI filter driver, so you end up
swimming against the current to get such a thing installed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Actually in my case it is not very that tricky as it is a virtual
display driver. So I would be able to do it in the software. However,
the GDI filter driver is really interesting. There is magic rotation
software which takes this approach. The tricky part for me is that I
have to make my driver compatible with this software. I am currently
looking into how this software works and GDI filter. Any suggestions
where to start?

Mudeem

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Monday, October 23, 2006 10:07 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Rotation support in display driver

anshul makkar wrote:

there is no need for the driver to tell it supports rotation.

also there is no need to tell to GDI that rotation has to be
performed.

Here you can use filter display driver, that will sit between actual
display driver and GDI.

You say that as if it were easy. It isn’t. There is no official
mechanism for writing and installing a GDI filter driver, so you end up
swimming against the current to get such a thing installed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

hi,
I am not saying its easy. But my point is that its possible and very much
feasible because I have done it .

And its not GDI filter driver , but display driver filter.

----- Original Message -----
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”
Sent: Monday, October 23, 2006 10:37 PM
Subject: Re: [ntdev] Rotation support in display driver

> anshul makkar wrote:
>
>>
>> there is no need for the driver to tell it supports rotation.
>>
>> also there is no need to tell to GDI that rotation has to be performed.
>>
>> Here you can use filter display driver, that will sit between actual
>> display driver and GDI.
>
>
> You say that as if it were easy. It isn’t. There is no official
> mechanism for writing and installing a GDI filter driver, so you end up
> swimming against the current to get such a thing installed.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>

hi,
for any filter , first step will be just to place it above the actual driver
and try to trap all the calls and parameters that are being passed to actual
driver.
After you trap the parameters , then next step will be to try to modify
them.

----- Original Message -----
From: “Mudeem Iqbal”
To: “Windows System Software Devs Interest List”
Sent: Monday, October 23, 2006 11:30 PM
Subject: RE: [ntdev] Rotation support in display driver

Actually in my case it is not very that tricky as it is a virtual
display driver. So I would be able to do it in the software. However,
the GDI filter driver is really interesting. There is magic rotation
software which takes this approach. The tricky part for me is that I
have to make my driver compatible with this software. I am currently
looking into how this software works and GDI filter. Any suggestions
where to start?

Mudeem

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Monday, October 23, 2006 10:07 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Rotation support in display driver

anshul makkar wrote:

>
> there is no need for the driver to tell it supports rotation.
>
> also there is no need to tell to GDI that rotation has to be
performed.
>
> Here you can use filter display driver, that will sit between actual
> display driver and GDI.

You say that as if it were easy. It isn’t. There is no official
mechanism for writing and installing a GDI filter driver, so you end up
swimming against the current to get such a thing installed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


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

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

anshul makkar wrote:

I am not saying its easy. But my point is that its possible and very
much feasible because I have done it .

And its not GDI filter driver , but display driver filter.

A display driver is a GDI driver. Do you mean a miniport filter?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi ,

GDI consists display driver and printer driver.

and miniport comes under wdm.

Here I am talking about display driver dll filter driver.

Yes, if display driver dll is called as GDI driver, then my reference is to
GDI driver filter driver.

----- Original Message -----
From: “Tim Roberts”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, October 25, 2006 10:26 PM
Subject: Re: [ntdev] Rotation support in display driver

> anshul makkar wrote:
>
>>
>> I am not saying its easy. But my point is that its possible and very
>> much feasible because I have done it .
>>
>> And its not GDI filter driver , but display driver filter.
>
>
> A display driver is a GDI driver. Do you mean a miniport filter?
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>