<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with setting rotation modes using IEGD driver on Windows 7 in Embedded Intel Atom® Processors</title>
    <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243378#M2004</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Sholten:&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Welcome to the Intel® Embedded Community.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Glad you figured it out.  And thanks for sharing the solution with the community!&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Thanks&lt;/P&gt; &lt;P&gt;Felix&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2010 21:46:28 GMT</pubDate>
    <dc:creator>FMcNu1</dc:creator>
    <dc:date>2010-09-09T21:46:28Z</dc:date>
    <item>
      <title>Problem with setting rotation modes using IEGD driver on Windows 7</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243376#M2002</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hi, I am able to use the gui utility to set the rotated modes on my device but am not able to programtically change the rotation following the example in the IEGD SDK.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The problem I am seeing is that the calls to ChangeDisplay Settings are failing with BADMODE ( -2 ) return code as a result of the mode not being valid when swapping width and height values. Call sequence looks like this with error checking removed:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;hdc = GetDC( Null );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rot_flip.port_number = (((&lt;/P&gt;&lt;P&gt;rot_flip.flip = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rot_flip.rotation = 90;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rot_flip.rotation = 0;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ExtEscape(hdc, INTEL_ESCAPE_SET_ROTATION_FLIP , input_size, rot_flip, 0, null);uint)hdc &amp;gt;&amp;gt; (PRIMARY * 4)) &amp;amp; 0x0f);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ReleaseDC(hdc);&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int  mode_num = 0; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// loop to refresh all available modes for this rotation setting &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while(true) &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   if (EnumDisplaySettings(null, mode_num++, dm_enum) == 0) &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   {&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      break&amp;lt;font co...&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2010 15:18:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243376#M2002</guid>
      <dc:creator>DScho4</dc:creator>
      <dc:date>2010-09-09T15:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting rotation modes using IEGD driver on Windows 7</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243377#M2003</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to figure it out ... needed to get an internal dc using ExtEscape and from there derive the port number. Once I had the port number right eveything else worked.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;No need to respond.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2010 19:47:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243377#M2003</guid>
      <dc:creator>DScho4</dc:creator>
      <dc:date>2010-09-09T19:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting rotation modes using IEGD driver on Windows 7</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243378#M2004</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Sholten:&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Welcome to the Intel® Embedded Community.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Glad you figured it out.  And thanks for sharing the solution with the community!&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Thanks&lt;/P&gt; &lt;P&gt;Felix&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2010 21:46:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243378#M2004</guid>
      <dc:creator>FMcNu1</dc:creator>
      <dc:date>2010-09-09T21:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting rotation modes using IEGD driver on Windows 7</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243379#M2005</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use the following example code to show people how to rotate.  It is a bit old so the api calls may need to be adjusted a bit to current calling convention but the logic is correct:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;# include # include &lt;/P&gt;&lt;P&gt;//          ............................................................................# define INTEL_ESCAPE_ROTATION_FLIP       0x2000E&lt;/P&gt;&lt;P&gt;# define IEGD_ANALOG_PORT  5&lt;/P&gt;&lt;P&gt;typedef struct _iegd_esc_set_rotation_flip {            unsigned long port_number;            unsigned long rotation; /* rotation in degrees (0, 90, 180, 270) */            unsigned long flip;     /* horizontal flip, zero or non-zero */} iegd_esc_set_rotation_flip_t;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;//          ............................................................................&lt;/P&gt;&lt;P&gt;void main(int argc, char *argv[]){            if (argc != 3)            {                        printf("Usage : \%s &amp;lt;0|90|180|270&amp;gt; &amp;lt;0|1&amp;gt;\n", argv[0]);                        return;            }&lt;/P&gt;&lt;P&gt;            //          ........................................................................            DEVMODE devModeCur;            if (! EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &amp;amp;devModeCur))            {                        printf("Error ! EnumDisplaySettings() failed with error=\%lu\n",                                       GetLastError());            }&lt;/P&gt;&lt;P&gt;            printf("Current Mode : mailt&lt;A&gt;o:\%dx\%dx\%d@\%d\n&lt;/A&gt; mailt&lt;A&gt;o:\%dx\%dx\%d@\%d\n&lt;/A&gt;"  rel="nofollow"&amp;gt;\%dx\%dx\%d@\%d\n",                           devModeCur.dmPelsWidth, devModeCur.dmPelsHeight,                           devModeCur.dmBitsPerPel, devModeCur.dmDisplayFrequency);&lt;/P&gt;&lt;P&gt;            //          ........................................................................            DEVMODE devModeRot;            ZeroMemory(&amp;amp;devModeRot, sizeof(DEVMODE));&lt;/P&gt;&lt;P&gt;            devModeRot.dmSize                    = sizeof(DEVMODE);            devModeRot.dmFields                  = DM_PELSWIDTH  | DM_PELSHEIGHT |                                                   DM_BITSPERPEL | DM_DISPLAYFREQUENCY;            devModeRot.dmBitsPerPel              = devModeCur.dmBitsPerPel;&lt;/P&gt;&lt;P&gt;            devModeRot.dmDisplayFrequency        = devModeCur.dmDisplayFrequency;&lt;/P&gt;&lt;P&gt;            //          ........................................................................            iegd_esc_rotation_flip_t rotFlip;&lt;/P&gt;&lt;P&gt;            rotFlip.port_number       = IEGD_ANALOG_PORT;            rotFlip.rotation  = atoi(argv[1]);            rotFlip.flip                     = atoi(argv[2]);&lt;/P&gt;&lt;P&gt;            switch (rotFlip.rotation)            {                        case 0   :                        case 180 :                        {                                    if (devModeCur.dmPelsWidth &amp;lt; devModeCur.dmPelsHeight)                                    {                                                //          We are in rotated mode                                                devModeRot.dmPelsWidth  = devModeCur.dmPelsHeight;                                                devModeRot.dmPelsHeight = devModeCur.dmPelsWidth;                                    }                                    else                                    {                                                devModeRot.dmPelsWidth  = devModeCur.dmPelsWidth;                                                devModeRot.dmPelsHeight = devModeCur.dmPelsHeight;                                    }&lt;/P&gt;&lt;P&gt;                                    break;                        }&lt;/P&gt;&lt;P&gt;                        case 90  :                        case 270 :                        {                                   if (devModeCur.dmPelsWidth &amp;lt; devModeCur.dmPelsHeight)                                    {                                               //          We are already in rotated mode                                                devModeRot.dmPelsWidth  = devModeCur.dmPelsWidth;                                                devModeRot.dmPelsHeight = devModeCur.dmPelsHeight;                                    }                                    else                                    {                                                devModeRot.dmPelsWidth  = devModeCur.dmPelsHeight;                                                devModeRot.dmPelsHeight = devModeCur.dmPelsWidth;                                    }&lt;/P&gt;&lt;P&gt;                                    break;                        }                                              default :                                    printf("Error ! Invalid paramter = \%d\n", rotFlip.rotation);                                    return;            }&lt;/P&gt;&lt;P&gt;            if (devModeRot.dmPelsWidth &amp;lt; 640)            {                        printf("Error ! width(\%d) &amp;lt; 640\n", devModeRot.dmPelsWidth);                        return;            }&lt;/P&gt;&lt;P&gt;            printf("Rotation=\%d, Flip=\%d\n", rotFlip.rotation, rotFlip.flip);&lt;/P&gt;&lt;P&gt;            //          ........................................................................            HDC hDC = GetDC(NULL);            if (hDC == NULL)            {                        printf("Error ! CreateDC() failed with error=\%d\n", GetLastError());                        return;            }&lt;/P&gt;&lt;P&gt;            int retCode = ExtEscape(hDC, INTEL_ESCAPE_SET_ROTATION_FLIP,                          sizeof(iegd_esc_rotation_flip_t), (char *)&amp;amp;rotFlip,                          0, NULL);&lt;/P&gt;&lt;P&gt;            if (retCode &amp;lt;= 0)&amp;lt;br/&amp;gt;            {                        printf("Error ! ExtEscape(INTEL_ESCAPE_SET_ROTATION_FLIP) returned \%d\n",                                       retCode);                        return;            }&lt;/P&gt;&lt;P&gt;            ReleaseDC(NULL, hDC);&lt;/P&gt;&lt;P&gt;            //          ........................................................................            DWORD modeNum = 0;&lt;/P&gt;&lt;P&gt;            while (1)            {                        DEVMODE devModeEnum;&lt;/P&gt;&lt;P&gt;                        if (! EnumDisplaySettings(NULL, modeNum, &amp;amp;devModeEnum))                                    break;&lt;/P&gt;&lt;P&gt;                        modeNum++;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 17:57:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243379#M2005</guid>
      <dc:creator>Kirk_B_Intel</dc:creator>
      <dc:date>2010-09-21T17:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting rotation modes using IEGD driver on Windows 7</title>
      <link>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243380#M2006</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;            }&lt;/P&gt;&lt;P&gt;            //          ........................................................................&lt;/P&gt;&lt;P&gt;            long status;&lt;/P&gt;&lt;P&gt;            if (devModeCur.dmPelsWidth == devModeRot.dmPelsWidth)            {                        if (devModeRot.dmBitsPerPel == 16)                                    devModeRot.dmBitsPerPel = 32;                        else if (devModeRot.dmBitsPerPel == 32)                                    devModeRot.dmBitsPerPel = 16;&lt;/P&gt;&lt;P&gt;                        status = ChangeDisplaySettings(&amp;amp;devModeRot, 0);&lt;/P&gt;&lt;P&gt;                        if (devModeRot.dmBitsPerPel == 16)                                    devModeRot.dmBitsPerPel = 32;                        else if (devModeRot.dmBitsPerPel == 32)                                    devModeRot.dmBitsPerPel = 16;            }&lt;/P&gt;&lt;P&gt;            printf("New Mode : mailt&lt;A&gt;o:\%dx\%dx\%d@\%d\n&lt;/A&gt; mailt&lt;A&gt;o:\%dx\%dx\%d@\%d\n&lt;/A&gt;"  rel="nofollow"&amp;gt;\%dx\%dx\%d@\%d\n",                           devModeRot.dmPelsWidth, devModeRot.dmPelsHeight,                           devModeRot.dmBitsPerPel, devModeRot.dmDisplayFrequency);&lt;/P&gt;&lt;P&gt;            status = ChangeDisplaySettings(&amp;amp;devModeRot, CDS_RESET | CDS_UPDATEREGISTRY | CDS_GLOBAL);            if (status != DISP_CHANGE_SUCCESSFUL)            {                        printf("Error ! ChangeDisplaySettings() failed with status=\%d\n", status);            }&lt;/P&gt;&lt;P&gt;            modeNum = 0;&lt;/P&gt;&lt;P&gt;            while (1)            {                        DEVMODE devModeEnum;&lt;/P&gt;&lt;P&gt;                        if (! EnumDisplaySettings(NULL, modeNum, &amp;amp;devModeEnum))                                    break;&lt;/P&gt;&lt;P&gt;                        modeNum++;            }}&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2010 17:57:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Embedded-Intel-Atom-Processors/Problem-with-setting-rotation-modes-using-IEGD-driver-on-Windows/m-p/243380#M2006</guid>
      <dc:creator>Kirk_B_Intel</dc:creator>
      <dc:date>2010-09-21T17:57:58Z</dc:date>
    </item>
  </channel>
</rss>

