wip prep commit in lieu of gfx subsystem update changes.
[AROS.git] / arch / arm-native / soc / broadcom / 2708 / hidd / videocoregfx / videocoregfx_hdmi.c
blob9a5498315fc73cab3f5ddb93e4f9d7fd630b0b9c
1 /*
2 Copyright © 2013-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 1
7 #include <aros/debug.h>
8 #include <proto/exec.h>
9 #include <proto/mbox.h>
10 #include <stdio.h>
12 #include "videocoregfx_class.h"
14 #ifdef MBoxBase
15 #undef MBoxBase
16 #endif
18 #define MBoxBase xsd->vcsd_MBoxBase
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_MBoxMessage[0] = 8 * 4;
30 xsd->vcsd_MBoxMessage[1] = VCTAG_REQ;
31 xsd->vcsd_MBoxMessage[2] = VCTAG_GETRES;
32 xsd->vcsd_MBoxMessage[3] = 8;
33 xsd->vcsd_MBoxMessage[4] = 0;
34 xsd->vcsd_MBoxMessage[5] = 0;
35 xsd->vcsd_MBoxMessage[6] = 0;
36 xsd->vcsd_MBoxMessage[7] = 0; // terminate tag
38 /* for now lets just get the mode the display is currently running.. */
39 MBoxWrite(VCMB_BASE, VCMB_PROPCHAN, xsd->vcsd_MBoxMessage);
40 if ((MBoxRead(VCMB_BASE, VCMB_PROPCHAN) == xsd->vcsd_MBoxMessage) &&
41 (xsd->vcsd_MBoxMessage[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_MBoxMessage[5];
47 hdmi_mode->dm_hstart = xsd->vcsd_MBoxMessage[5];
48 hdmi_mode->dm_hend = xsd->vcsd_MBoxMessage[5];
49 hdmi_mode->dm_htotal = xsd->vcsd_MBoxMessage[5];
50 hdmi_mode->dm_vdisp = xsd->vcsd_MBoxMessage[6];
51 hdmi_mode->dm_vstart = xsd->vcsd_MBoxMessage[6];
52 hdmi_mode->dm_vend = xsd->vcsd_MBoxMessage[6];
53 hdmi_mode->dm_vtotal = xsd->vcsd_MBoxMessage[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;