turn off debug
[AROS.git] / arch / arm-raspi / hidd.videocoregfx / videocoregfx_hdmi.c
blob8f3323ccebc74587b2e8c76717b1c2cfeb7173fc
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
8 #include <proto/exec.h>
9 #include <proto/vcmbox.h>
10 #include <stdio.h>
12 #include "videocoregfx_class.h"
14 #ifdef VCMBoxBase
15 #undef VCMBoxBase
16 #endif
18 #define VCMBoxBase xsd->vcsd_VCMBoxBase
20 int FNAME_SUPPORT(HDMI_SyncGen)(struct List *modelist, OOP_Class *cl)
22 struct VideoCoreGfx_staticdata *xsd = XSD(cl);
23 struct DisplayMode *hdmi_mode;
24 int hdmi_modecount = 0;
26 D(bug("[VideoCoreGfx] %s()\n", __PRETTY_FUNCTION__));
28 #warning "TODO: check if anything is attached to HDMI/DVI"
29 xsd->vcsd_VCMBoxMessage[0] = 8 * 4;
30 xsd->vcsd_VCMBoxMessage[1] = VCTAG_REQ;
31 xsd->vcsd_VCMBoxMessage[2] = VCTAG_GETRES;
32 xsd->vcsd_VCMBoxMessage[3] = 8;
33 xsd->vcsd_VCMBoxMessage[4] = 0;
34 xsd->vcsd_VCMBoxMessage[5] = 0;
35 xsd->vcsd_VCMBoxMessage[6] = 0;
36 xsd->vcsd_VCMBoxMessage[7] = 0; // terminate tag
38 /* for now lets just get the mode the display is currently running.. */
39 VCMBoxWrite(VCMB_BASE, VCMB_PROPCHAN, xsd->vcsd_VCMBoxMessage);
40 if ((VCMBoxRead(VCMB_BASE, VCMB_PROPCHAN) == xsd->vcsd_VCMBoxMessage) &&
41 (xsd->vcsd_VCMBoxMessage[1] == VCTAG_RESP))
43 if ((hdmi_mode = AllocMem(sizeof(struct DisplayMode), MEMF_PUBLIC)) != NULL)
45 hdmi_mode->dm_clock = 25174;
46 hdmi_mode->dm_hdisp = xsd->vcsd_VCMBoxMessage[5];
47 hdmi_mode->dm_hstart = xsd->vcsd_VCMBoxMessage[5];
48 hdmi_mode->dm_hend = xsd->vcsd_VCMBoxMessage[5];
49 hdmi_mode->dm_htotal = xsd->vcsd_VCMBoxMessage[5];
50 hdmi_mode->dm_vdisp = xsd->vcsd_VCMBoxMessage[6];
51 hdmi_mode->dm_vstart = xsd->vcsd_VCMBoxMessage[6];
52 hdmi_mode->dm_vend = xsd->vcsd_VCMBoxMessage[6];
53 hdmi_mode->dm_vtotal = xsd->vcsd_VCMBoxMessage[6];
54 hdmi_mode->dm_descr = AllocVec(256, MEMF_CLEAR);
56 sprintf(hdmi_mode->dm_descr, "VideoCore: HDMI %dx%d", hdmi_mode->dm_hdisp, hdmi_mode->dm_vdisp);
57 AddTail(modelist, &hdmi_mode->dm_Node);
58 hdmi_modecount++;
62 return hdmi_modecount;