2011/4/2 Mathieu Taillefumier <mathieu.taillefum...@free.fr>:
> Hey,
>
> do you want some specific tests about the patch ?
Well, basically feel free to test every function. I tested a couple of
functions, but cannot test every function since my IBM T60 display's
EDID doesn't comply with the standard.

Find attached a little test program, which just test a subset of what
I implemented in terms of data extraction. For lazyness' sake you'll
have to pass it root windows and output ids. The instructions to do it
are given as comments in the code.

BR,

Leif

*snap*
sorry, embedded patch was too long ;-)
/*
 * Compile:
 * gcc edid_test.c `pkg-config --cflags --libs ecore-x` -o /tmp/edid-test
 */

/*
 * Pass root window id and output id as parameters!
 *
 * root window id:
 * xwininfo -root | grep root | awk '{print $4}'
 *
 * output id:
 * Choose the corresponding identifier from the
 * output of the following command:
 * xrandr --verbose
 */

#include <Ecore_X.h>
#include <Eina.h>
#include <stdio.h>

int main(int argc, const char *argv[])
{
   short version;
   unsigned char *edid;
   unsigned long edid_length;
   int i;
   Ecore_X_Window root = 0x157;
   Ecore_X_Randr_Output output = 0x52;

   if (argc == 3)
     {
        sscanf(argv[1], "%x", &root);
        sscanf(argv[2], "%x", &output);
     }
   else
     {
        printf("Usage: %s rootwindow-id output-id\n"
              "See source for details on how to obtain these values.\n",
              argv[0]);

        return -1;
     }
   ecore_x_init(":0.0");
   edid = ecore_x_randr_output_edid_get(root, output, &edid_length);
   ecore_x_shutdown();

   if (!edid)
     {
        printf("Could not get EDID information for root window %x, output %x.\n", root, output);
        return -1;
     }

   printf("EDID length: %ld\n", edid_length);

   if (edid_length < 128)
     {
        printf("Broken EDID information!\n");
        return -1;
     }

   printf("EDID:");
   for (i = 0; i < edid_length; i++)
     {
        if ((i % 16) == 0) printf("\n\t");
        printf("%02x", edid[i]);
     }
   printf("\n");

   printf("Has a valid header: %d\n", ecore_x_randr_edid_has_valid_header(edid, edid_length));

   printf("Manufacturer name: %s\n", ecore_x_randr_edid_manufacturer_name_get(edid, edid_length));

   printf("Display name: %s\n", ecore_x_randr_edid_display_name_get(edid, edid_length));

   printf("ASCII name: %s\n", ecore_x_randr_edid_display_ascii_get(edid, edid_length));

   version = ecore_x_randr_edid_version_get(edid, edid_length);
   printf("EDID version: %x.%x\n", (version >> 8), (version & 0x00ff));

   printf("Number of Extension blocks: %d\n", edid[126]);

   if (edid) free(edid);

   return 0;
}
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to