tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

HDMI transmitter interface



Hello,
I made some progress on the TDA19988 HDMI transmitter driver as
found in the beaglebone black (doens't work yet, sorry :).
The driver will attach directly to the i2c bus, because other
devices are also connected to this bus (eeprom, the power managenent IC, and
more depending on connected capes). Then the TDA19988 driver and the
video drivers have to talk together: the TDA19988 driver knows when a
monitor is connected/disconnected and also can read the EDID, and
the video driver knows which mode to select.

The kernel config looks like this:
tifb*   at obio0 addr 0x4830E000 size 0x1000 intr 36
# tda19988 HDMI transmitter (beagelbone black)
tda19988hdmi0   at iic0 addr 0x70 #also uses addr 0x34
options         TIFB_TRANSMITTER="\"tda19988hdmi0\""
options         TIFB_TRANSMITTER_BPP=16

TIFB_TRANSMITTER and TIFB_TRANSMITTER_BPP are used by the tifb driver
only. the string in TIFB_TRANSMITTER allows tifb(4) to do a
device_find_by_xname() to find the tda19988hdmi0's device_t
(at this time this means that iic0 has to be attached first).

tifb(4) and tda19988hdmi(4) shares a structure declared in
sys/dev/videomode/video_transmitter.h (new file):
struct video_transmitter {
        device_t        vdt_t_dev; /* video transmitter device */
        device_t        vdt_c_dev; /* video controller device */
        /*
         * data we got from the monitor. Can be filled either by the
         * transmitter or the controller driver
         */
        uint8_t         vdt_edid_data[128];
        struct edid_info vdt_edid_info;
        bool            vdt_edid_valid;
        bool            vdt_display_attached;
        /* callbacks from the transmitter to the controller */
        bool            vdt_controller_valid;
        void            (*vdt_t2c_monitor_changed)(device_t);
        /* callbacks from the controller to the transmitter */
        bool            vdt_transmitter_valid;
        void            (*vdt_c2t_mode_changed)(device_t, struct videomode *);
};

Part of this structure is filled in by tifb(4), and part by tda19988hdmi(4).
It's at the start of the tda19988hdmi_softc structure, so that
tifb(4) can find it with
	struct video_transmitter *vdt =
	    device_private(device_find_by_xname(TIFB_TRANSMITTER));
(more or less, of course device_find_by_xname() is cached,
 the return value is checked for NULL, etc ...).
edid_info and vdt_edid_valid could be filled by either, depending
on which one can get the info (in my case it's tda19988hdmi).

When tda19988hdmi detects a monitor change, or at attach time, it
calls *vdt_t2c_monitor_changed() to inform the video controller.
Once the video controller has picked up a new mode, it calls
vdt_c2t_mode_changed().

I hope this is generic enough to be used by other controller and transmitter
driver, so that only a kernel config change is needed to get one working
with another.

Any comment on this interface ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--



Home | Main Index | Thread Index | Old Index