proxy: Export display functions

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-06-01 00:49:40 +09:00
parent 09013da441
commit 0472bc05cd
3 changed files with 27 additions and 0 deletions

View file

@ -598,6 +598,10 @@ class M1N1Proxy(Reloadable):
P_MCC_GET_CARVEOUTS = 0x1000
P_DISPLAY_INIT = 0x1100
P_DISPLAY_CONFIGURE = 0x1101
P_DISPLAY_SHUTDOWN = 0x1102
def __init__(self, iface, debug=False):
self.debug = debug
self.iface = iface
@ -1032,6 +1036,13 @@ class M1N1Proxy(Reloadable):
def mcc_get_carveouts(self):
return self.request(self.P_MCC_GET_CARVEOUTS)
def display_init(self):
return self.request(self.P_DISPLAY_INIT)
def display_configure(self, cfg):
return self.request(self.P_DISPLAY_CONFIGURE, cfg)
def display_shutdown(self):
return self.request(self.P_DISPLAY_SHUTDOWN)
__all__.extend(k for k, v in globals().items()
if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)

View file

@ -2,6 +2,7 @@
#include "proxy.h"
#include "dart.h"
#include "display.h"
#include "exception.h"
#include "fb.h"
#include "gxf.h"
@ -520,6 +521,16 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
reply->retval = (u64)mcc_carveouts;
break;
case P_DISPLAY_INIT:
reply->retval = display_init();
break;
case P_DISPLAY_CONFIGURE:
reply->retval = display_configure((char *)request->args[0]);
break;
case P_DISPLAY_SHUTDOWN:
display_shutdown();
break;
default:
reply->status = S_BADCMD;
break;

View file

@ -147,6 +147,11 @@ typedef enum {
P_NVME_FLUSH,
P_MCC_GET_CARVEOUTS = 0x1000,
P_DISPLAY_INIT = 0x1100,
P_DISPLAY_CONFIGURE = 0x1101,
P_DISPLAY_SHUTDOWN = 0x1102,
} ProxyOp;
#define S_OK 0