| /* |
| * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without modification, are permitted |
| * provided that the following conditions are met: |
| * * Redistributions of source code must retain the above copyright notice, this list of |
| * conditions and the following disclaimer. |
| * * Redistributions in binary form must reproduce the above copyright notice, this list of |
| * conditions and the following disclaimer in the documentation and/or other materials provided |
| * with the distribution. |
| * * Neither the name of The Linux Foundation nor the names of its contributors may be used to |
| * endorse or promote products derived from this software without specific prior written |
| * permission. |
| * |
| * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| |
| #ifndef __VM_INTERFACE_H__ |
| #define __VM_INTERFACE_H__ |
| |
| #define SDM_COMP_SERVICE_ID 5006 |
| #define SDM_COMP_SERVICE_VERSION 1 |
| #define SDM_COMP_SERVICE_INSTANCE 1 |
| |
| #define VM_INTF_REVISION_MAJOR (1) |
| #define VM_INTF_REVISION_MINOR (4) |
| |
| #define VM_INTF_VERSION ((uint16_t) ((VM_INTF_REVISION_MAJOR << 8) | VM_INTF_REVISION_MINOR)) |
| |
| enum CommandId { |
| kCmdExportDemuraBuffers = 0, |
| kCmdSetBacklight = 1, |
| kCmdSetDisplayConfig = 2, |
| kCmdSetProperties = 3, |
| kCmdSetPanelBootParams = 4, |
| kCmdMax, |
| }; |
| |
| enum DisplayType { |
| kDisplayTypePrimary = 0, |
| kDisplayTypeSecondary1 = 1, |
| kDisplayTypeMax, |
| }; |
| |
| typedef struct DemuraMemInfo_t { |
| int64_t calib_mem_hdl = -1; |
| int64_t hfc_mem_hdl = -1; |
| uint32_t calib_mem_size = 0; |
| uint32_t hfc_mem_size = 0; |
| uint64_t panel_id = 0; |
| uint32_t calib_payload_size = 0; |
| char file_name[128]; |
| } DemuraMemInfo; |
| |
| typedef struct Property_t { |
| char prop_name[48] = { 0 }; |
| char value[128] = { 0 }; |
| } Property; |
| |
| typedef struct Properties_t { |
| Property property_list[2] = {}; |
| int count = -1; |
| } Properties; |
| |
| typedef struct CommandHeader_t { |
| uint16_t version = VM_INTF_VERSION;; |
| int32_t id = -1; |
| } CommandHeader; |
| |
| typedef struct ResponseHeader_t { |
| int32_t id = -1; |
| int32_t status = -1; |
| } ResponseHeader; |
| |
| // Command and Response structure definitions to start TUI session |
| typedef struct CmdExportDemuraBuffer_t { |
| union { |
| DemuraMemInfo demura_mem_info; |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } CmdExportDemuraBuffer; |
| |
| typedef struct RspExportDemuraBuffer_t { |
| union { |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } RspExportDemuraBuffer; |
| |
| // Command and Response structure definitions to set backlight for a specified display |
| typedef struct CmdSetBacklight_t { |
| union { |
| struct { |
| float brightness; |
| DisplayType disp_type; |
| }; |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } CmdSetBacklight; |
| |
| typedef struct RspSetBacklight_t { |
| union { |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } RspSetBacklight; |
| |
| // Command and Response structure definitions to set display config mode |
| typedef struct CmdSetDisplayConfigs_t { |
| union { |
| struct { |
| uint32_t x_pixels; |
| uint32_t y_pixels; |
| uint32_t v_total; |
| uint32_t h_total; |
| uint32_t fps; |
| int config_idx; |
| DisplayType disp_type; |
| bool smart_panel; |
| }; |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } CmdSetDisplayConfigs; |
| |
| typedef struct RspSetDisplayConfigs_t { |
| union { |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } RspSetDisplayConfigs; |
| |
| // Command and Response structure definitions to propagate the android property |
| typedef struct CmdSetProperties_t { |
| union { |
| Properties props; |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } CmdSetProperties; |
| |
| typedef struct RspSetProperties_t { |
| union { |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } RspSetProperties; |
| |
| // Command and Response structure to set panel boot parameters to insmod of display drivers |
| typedef struct CmdSetPanelBootParam_t { |
| union { |
| char panel_boot_string[256]; |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } CmdSetPanelBootParam; |
| |
| typedef struct RspSetPanelBootParam_t { |
| union { |
| uint32_t reserve[128] = { 0 }; |
| }; |
| } RspSetPanelBootParam; |
| |
| struct Command : CommandHeader { |
| Command() {} |
| union { |
| CmdExportDemuraBuffer cmd_export_demura_buf; |
| CmdSetBacklight cmd_set_backlight; |
| CmdSetDisplayConfigs cmd_set_disp_configs; |
| CmdSetProperties cmd_set_properties; |
| CmdSetPanelBootParam cmd_set_panel_boot_param; |
| }; |
| }; |
| |
| struct Response : ResponseHeader { |
| Response() {} |
| union { |
| RspExportDemuraBuffer rsp_export_demura_buf; |
| RspSetBacklight rsp_set_backlight; |
| RspSetDisplayConfigs rsp_set_disp_configs; |
| RspSetProperties rsp_set_properties; |
| RspSetPanelBootParam rsp_set_panel_boot_param; |
| }; |
| }; |
| |
| #endif // __VM_INTERFACE_H__ |
| |