m1n1.fw.dcp: Add callbacks used by t600x-dcp

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2022-03-07 23:46:10 +01:00 committed by Hector Martin
parent 7028f3e2d8
commit d1d93eb2b5
2 changed files with 20 additions and 1 deletions

View file

@ -615,6 +615,7 @@ class IOMobileFramebufferAP(IPCObject):
D576 = Callback(void, "hotPlug_notify_gated", ulong)
D577 = Callback(void, "powerstate_notify", bool_, bool_)
D582 = Callback(bool_, "create_default_fb_surface", uint, uint)
D583 = Callback(bool_, "serializeDebugInfoCb", ulong, InPtr(uint64_t), uint)
D589 = Callback(void, "swap_complete_ap_gated", uint, bool_, InPtr(SwapCompleteData), SwapInfoBlob, uint)
@ -624,6 +625,8 @@ class IOMobileFramebufferAP(IPCObject):
class ServiceRelay(IPCObject):
D401 = Callback(bool_, "sr_get_uint_prop", obj=FourCC, key=string(0x40), value=InOutPtr(ulong))
D404 = Callback(void, "sr_set_uint_prop", obj=FourCC, key=string(0x40), value=uint)
D406 = Callback(void, "set_fx_prop", obj=FourCC, key=string(0x40), value=uint)
D408 = Callback(uint64_t, "sr_getClockFrequency", obj=FourCC, arg=uint)
D411 = Callback(IOMFBStatus, "sr_mapDeviceMemoryWithIndex", obj=FourCC, index=uint, flags=uint, addr=OutPtr(ulong), length=OutPtr(ulong))
D413 = Callback(bool_, "sr_setProperty_dict", obj=FourCC, key=string(0x40), value=InPtr(Padded(0x1000, OSDictionary())))

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: MIT
import pprint
import struct, functools
import struct, functools, time
from dataclasses import dataclass
from enum import IntEnum
@ -188,10 +188,17 @@ class DCPManager(DCPBaseManager):
def powerstate_notify(self, unk1, unk2):
print(f"powerstate_notify({unk1}, {unk2})")
def create_default_fb_surface(self, width, height):
print(f"create_default_fb_surface({width}x{height})")
return True
def powerUpDART(self, unk):
print(f"powerUpDART({unk})")
return 0
def hotPlug_notify_gated(self, unk):
print(f"hotPlug_notify_gated({unk})")
def is_waking_from_hibernate(self):
return False
@ -203,6 +210,9 @@ class DCPManager(DCPBaseManager):
def match_backlight_service(self):
return True
def get_calendar_time_ms(self):
return time.time_ns() // 1000_000
def map_buf(self, buf, vaddr, dva, unk):
print(f"map buf {buf}, {unk}")
paddr, dcpdva, dvasize = self.bufs[buf]
@ -228,6 +238,12 @@ class DCPManager(DCPBaseManager):
value.val = 0
return False
def sr_set_uint_prop(self, obj, key, value):
print(f"sr_set_uint_prop({obj}, {key} = {value})")
def set_fx_prop(self, obj, key, value):
print(f"set_fx_prop({obj}, {key} = {value})")
def sr_mapDeviceMemoryWithIndex(self, obj, index, flags, addr, length):
assert obj == "PROV"
addr.val, length.val = self.dcp.u.adt["/arm-io/disp0"].get_reg(index)