replace common qcom sources with samsung ones

This commit is contained in:
SaschaNes
2025-08-12 22:13:00 +02:00
parent ba24dcded9
commit 6f7753de11
5682 changed files with 2450203 additions and 103634 deletions

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_COMPOSITOR_CB_INTF_H__
#define __SDM_COMPOSITOR_CB_INTF_H__
#include <core/sdm_types.h>
namespace sdm {
class SDMCompositorCbIntf {
public:
virtual ~SDMCompositorCbIntf() {}
virtual void OnHotplug(uint64_t in_display, bool in_connected) = 0;
virtual void OnRefresh(uint64_t in_display) = 0;
virtual void OnVsync(uint64_t in_display, int64_t in_timestamp,
int32_t in_vsync_period_nanos) = 0;
virtual void OnSeamlessPossible(uint64_t in_display) = 0;
virtual void OnVsyncIdle(uint64_t in_display) = 0;
virtual void
OnVsyncPeriodTimingChanged(uint64_t in_display,
const SDMVsyncPeriodChangeTimeline &timeline) = 0;
};
} // namespace sdm
#endif // __SDM_COMPOSITOR_CB_INTF_H__

View File

@@ -0,0 +1,97 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_COMPOSITOR_SIDEBAND_CB_INTF_H__
#define __SDM_COMPOSITOR_SIDEBAND_CB_INTF_H__
#include <core/sdm_types.h>
#include <private/generic_payload.h>
#define NUM_HISTOGRAM_COLOR_COMPONENTS 4
namespace sdm {
class SDMSideBandCompositorCbIntf {
public:
virtual ~SDMSideBandCompositorCbIntf() {}
virtual void NotifyQsyncChange(uint64_t display_id, bool qsync_enabled,
uint32_t refresh_rate,
uint32_t qsync_refresh_rate) = 0;
virtual void NotifyCameraSmoothInfo(SDMCameraSmoothOp op, int32_t fps) = 0;
virtual void NotifyResolutionChange(uint64_t display_id,
SDMConfigAttributes &attr) = 0;
virtual void NotifyTUIEventDone(uint32_t ret, uint32_t disp_id,
SDMTUIEventType type) = 0;
virtual void NotifyIdleStatus(bool status) = 0;
virtual void NotifyCWBStatus(int32_t status, void *buffer) = 0;
virtual void NotifyContentFps(const std::string& name, int32_t fps) = 0;
// qservice
virtual void OnHdmiHotplug(bool connected) = 0;
virtual void OnCECMessageReceived(char *message, int len) = 0;
// gl color convert callbacks
virtual void InitColorConvert(uint64_t display, bool secure) = 0;
virtual void ColorConvertBlit(uint64_t display,
ColorConvertBlitContext *ctx) = 0;
virtual void ResetColorConvert(uint64_t display) = 0;
virtual void DestroyColorConvert(uint64_t display) = 0;
// Histogram callbacks
virtual void StartHistogram(uint64_t display, int max_frames) = 0;
virtual void StopHistogram(uint64_t display, bool teardown) = 0;
virtual void NotifyHistogram(uint64_t display, int fd, uint64_t blob_id,
uint32_t panel_width, uint32_t panel_height) = 0;
virtual std::string DumpHistogram(uint64_t display) = 0;
virtual void
CollectHistogram(uint64_t display, uint64_t max_frames, uint64_t timestamp,
int32_t samples_size[NUM_HISTOGRAM_COLOR_COMPONENTS],
uint64_t *samples[NUM_HISTOGRAM_COLOR_COMPONENTS],
uint64_t *numFrames) = 0;
virtual DisplayError
GetHistogramAttributes(uint64_t display, int32_t *format, int32_t *dataspace,
uint8_t *supported_components) = 0;
// gl layer stitch
virtual void StitchLayers(uint64_t display, LayerStitchContext *params) = 0;
virtual void InitLayerStitch(uint64_t display) = 0;
virtual void DestroyLayerStitch(uint64_t display) = 0;
// misc
virtual nsecs_t SystemTime(int clock) = 0;
virtual int GetDemuraFilePaths(const GenericPayload &in,
GenericPayload *out) = 0;
};
} // namespace sdm
#endif // __SDM_COMPOSITOR_SIDEAND_CB_INTF_H__

View File

@@ -0,0 +1,107 @@
/*
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_AIQE_H__
#define __SDM_DISPLAY_INTF_AIQE_H__
#include <core/sdm_types.h>
namespace sdm {
/**
* The purpose of this interface is to set/get any AIQE configuration options
* that can be changed within a display's lifetime.
*/
class SDMDisplayAiqeIntf {
public:
virtual ~SDMDisplayAiqeIntf(){};
/**
* Set the ssrc mode on the given display
*
* @param display_id: The id of the specified display
* @param mode_name: String form of the requested SSRC mode
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the given SSRC mode is not valid
* @exception: kErrorResources if the display doesn't support SSRC
*/
virtual DisplayError SetSsrcMode(uint64_t display_id,
const std::string &mode_name) = 0;
/**
* Set the COPR enablement state on the given display
*
* @param display_id: The id of the specified display
* @param enable: Enablement state of COPR. True is ON, False is OFF
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorResources if the display doesn't support COPR
*/
virtual DisplayError EnableCopr(uint64_t display_id, bool enable) = 0;
/**
* Retrieve the COPR stats on the given display
*
* @param display_id: The id of the specified display
* @param copr_status: Vector to return the COPR stats into
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if an error occured when querying the COPR
* status
* @exception: kErrorResources if the display doesn't support COPR
*/
virtual DisplayError GetCoprStats(uint64_t display_id,
std::vector<int32_t> *copr_status) = 0;
/**
* Set the ABC state(enable/disable) on the given display
*
* @param display_id: The id of the specified display
* @param state: State to set for ABC. 1 for enable, 0 for disable
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorResources if the display doesn't support ABC
*/
virtual DisplayError SetABCState(uint64_t display_id, bool state) = 0;
/**
* Reconfig the ABC on the given display
*
* @param display_id: The id of the specified display
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorResources if the display doesn't support ABC
*/
virtual DisplayError SetABCReconfig(uint64_t display_id) = 0;
/**
* Set the ABC with given mode on the given display
*
* @param display_id: The id of the specified display
* @param mode_name: Mode name to be set to ABC
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorResources if the display doesn't support ABC
*/
virtual DisplayError SetABCMode(uint64_t display_id,
std::string mode_name) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_AIQE_H__

View File

@@ -0,0 +1,284 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_CAPS_H__
#define __SDM_DISPLAY_INTF_CAPS_H__
#include <core/core_interface.h>
#include <core/display_interface.h>
#include <core/sdm_types.h>
namespace sdm {
/**
* This is a discovery interface for a system backend to determine the types
* and capabilities of the possible displays that could be connected.
*
* Not as much documentation here is necessary for life cycle, effects, etc.
* since this is a read-only interface.
*
* Exceptions will be returned as the service specific error code
* in a ScopedAStatus object, so in case of a method failure, check that
* code to see what went wrong. The code corresponds to the SdmClientError enum
*/
class SDMDisplayCapsIntf {
public:
virtual ~SDMDisplayCapsIntf() {}
virtual bool GetComposerStatus() = 0;
/**
* Get a list of currently connected displays, along with their display type,
* display id, and other display + panel info
*/
virtual DisplayError GetDisplaysStatus(HWDisplaysInfo *ret) = 0;
/**
* Query the capacities for a certain display type in the system
*
* @return: Number of diplays of the given type that are supported
*/
virtual DisplayError GetMaxDisplaysSupported(SDMDisplayType in_type,
int32_t *ret) = 0;
virtual DisplayError GetDisplayType(uint64_t display_id, int32_t *ret) = 0;
/**
* Get identification into for a given display. This info is static and will
* never change so clients can call this once and save the information.
*
* @param display_id: The id of the specified display
*
* @return: DisplayIdentificationParcel
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorDriverData if driver fails to provide the data on request
*/
virtual DisplayError GetDisplayIdentificationData(uint64_t display_id,
uint8_t *port,
uint32_t *size,
uint8_t *data) = 0;
/**
* Get the maximum backlight level for the specified display, if it is
* applicable
*
* @param display_id: The id of the specified display
*
* @return: int value of backlight max level
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetPanelBlMaxLvl(uint64_t display_id, int32_t *ret) = 0;
/**
* Get the max brightness level for a specified display
*
* @param display_id: The id of the specified display
*
* @return: int value of max brightness level
*
* @exception kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn't have a panel with
* brightness support
*/
virtual DisplayError GetPanelMaxBrightness(uint64_t display_id,
int32_t *ret) = 0;
/**
* Get the inclusive range for a display's possible refresh rates
* The min and max refresh rates will be the same if the display doesn't
* contain custom hardware panel info, typically for secondary displays and
* command mode panels
*
* @param display_id: The id of the specified display
*
* @return: List of min and max refresh rates. min[i] and max[i] are a pair
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetRefreshRateRange(uint64_t display_id, uint32_t *min,
uint32_t *max) = 0;
/**
* Check if underscan is supported for the given display
* Only applicable to external/pluggable displays
*
* @param display_id: The id of the specified display
*
* @return boolean: true if underscan is supported, else false
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError IsUnderScanSupported(uint64_t display_id, bool *ret) = 0;
/**
* Get the attributes of a specified color mode on a given display
*
* @param display_id: The id of the specified display
* @param color_mode: The color mode in string form to get attributes of
*
* @return: list of attribute key/values for the color mode, both in string
* form. AIDL doesn't support maps in ndk backend yet, so it will be a list
* instead and any client calling this function will have to search the list
* manually
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display's color manager failed to
* load or if the requested color mode doesn't have an attribute
*/
virtual DisplayError
GetColorModeAttr(uint64_t display_id, const std::string &in_color_mode,
std::vector<ColorModeAttributeVal> *ret) = 0;
/**
* Get the default color mode for the given display, in string mode
*
* @param display_id: The id of the specified display
*
* @return: string value of the display's default color mode
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display's color manager failed to
* load
*/
virtual DisplayError GetDefaultColorMode(uint64_t display_id,
std::string *ret) = 0;
// TODO(JJ): can encapsulate this in identification info to minimize traffic
virtual DisplayError GetDisplayPort(uint64_t display_id,
DisplayPort *ret) = 0;
/**
* Check if the display supports low power mode
* Generally, only builtin displays will support this mode
*
* @param display_id: The id of the specified display
*
* @return: true if the display supports low power modes
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetDozeSupport(uint64_t display_id, int32_t *ret) = 0;
/**
* Get the supported DSI clock rates for a given display
*
* @param display_id: The id of the specified display
*
* @return: list of supported clock rates in long form
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display is not builtin/doesn't use
* DSI
*/
virtual DisplayError GetSupportedDSIClock(uint64_t display_id,
std::vector<int64_t> *ret) = 0;
/**
* Get a list of the supported stc color modes for the given display
* Generally only supported for builtin displays
*
* @param display_id: The id of the specified display
*
* @return: List of supported stc color modes
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn't support stc color
* modes
*/
virtual DisplayError GetStcColorModes(uint64_t display_id) = 0;
/**
* Check if the given feature is supported on the given display
*
* @param display_id: The id of the given display
* @param feature: The requested feature
*
* @return: true if requested feature is supported on given display
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError IsSupportedOnDisplay(uint64_t display_id,
SupportedDisplayFeature in_feature,
bool *ret) = 0;
/**
* Check the hdr capabilities on a given display
*
* @param display_id: The id of the specified display
*
* @return: parcel containing info about the display's hdr capabilities
* each pair at slot [i] is a tuple
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetHdrCapabilities(uint64_t display_id,
uint32_t *out_num_types,
int32_t *out_types,
float *out_max_luminance,
float *out_max_average_luminance,
float *out_min_luminance) = 0;
virtual DisplayError
GetDisplayConnectionType(uint64_t display_id,
DisplayClass *display_class) = 0;
virtual uint32_t GetMaxVirtualDisplayCount() = 0;
virtual DisplayError GetFixedConfig(uint64_t display_id,
DisplayConfigFixedInfo *info) = 0;
virtual DisplayError GetDisplayConfigs(uint64_t display_id,
std::vector<int32_t> *out_configs) = 0;
virtual void GetCapabilities(uint32_t *outCount,
int32_t *outCapabilities) = 0;
virtual DisplayError IsWbUbwcSupported(bool *value) = 0;
virtual DisplayError IsSmartPanelConfig(uint64_t display_id,
uint32_t config_id,
bool *is_smart) = 0;
virtual bool IsRotatorSupportedFormat(LayerBufferFormat format) = 0;
virtual DisplayError GetDisplayHwId(uint64_t disp_id,
int32_t *disp_hw_id) = 0;
virtual DisplayError GetSupportedDisplayRefreshRates(
int disp_id, std::vector<uint32_t> *supported_refresh_rates) = 0;
virtual bool IsModeSwitchAllowed(uint64_t disp_id, int32_t config) = 0;
virtual DisplayError GetDisplayPortId(uint32_t disp_id, int *port_id) = 0;
virtual DisplayError IsCacV2Supported(uint32_t disp_id, bool *supported) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_CAPS_H__

View File

@@ -0,0 +1,250 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_DRAWCYCLE_H__
#define __SDM_DISPLAY_INTF_DRAWCYCLE_H__
#include <color_metadata.h>
#include <core/display_interface.h>
#include <core/layer_stack.h>
#include <core/sdm_types.h>
#include <utils/fence.h>
namespace sdm {
class SDMDisplayDrawCycleIntf {
public:
SDMDisplayDrawCycleIntf() {}
virtual ~SDMDisplayDrawCycleIntf() {}
/**
* Attempt to prepare and present a layer stack to the specified display in
* one call.
*
* SDM will always assume a full layer stack, so any incremental builds or
* optimizations must be done in compositor backend before submitting the
* layer stack.
*
* If SDM is unable to handle the layer stack, return an error code with
* details on what the client needs to do next, and afterwards, resubmit the
* layer stack to thie method.
*
* The layer stack should not be modified until this call returns to avoid any
* concurrency issues.
*
* FBT = Frame Buffer Target
*
* Draw method contracts:
* - Unified
* - Unified with GPU target
*
* @param display_id: The id of the specified display
* @param draw_method: The method SDM will use to draw the layer stack
* @param layer_stack: pointer to the layer stack to be presented
*
* @return: SUCCESS: SDM was able to prepare and present the layer stack in
* one call NEED_FENCE_BIND: If a fbt was submitted with a speculative fence,
* NEED_FBT: If SDM is unable to handle all of the layers, the layers
* which cannot be handled will be marked for GPU comp. Client must send those
* layers to GPU and resubmit layer stack with an fbt on top FAILED: If a
* fatal error occurs when attempting to present. Check the returned error
* code to see what went wrong
*/
virtual DisplayError PresentDisplay(uint64_t display_id,
DisplayDrawMethod draw_method,
LayerStack *layer_stack,
SDMPresentResult *present_type) = 0;
/**
* Flush any pending buffers/fences submitted previously through a
* PresentDisplay() call
*
* Client shall call this method to request SDM to release all buffers and
* respective fences currently in use. This may result in a blank display
* until a new frame is submitted.
*
* @param display_id: The id of the specified display
* @param layer_stack: The layer stack to flush
*/
virtual DisplayError Flush(uint64_t display_id, LayerStack *layer_stack) = 0;
/**
* Client can use this method to enable/disable a specific type of layer
* composition. If client disables a composition type, SDM will not handle any
* of the layer composition using the disabled method in a draw cycle. On lack
* of resources to handle all layers using other enabled composition methods,
* Prepare() will return an error.
*
* Default state of all composition types is enabled
*
* @param display_id: The id of the specified display
* @param composition: The type of composition to enable/disable
* @param enable: Enable or disable comp type
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the comp type cannot be disabled/enabled
* - Currently, only gpu comp can be disabled
*/
virtual DisplayError SetCompositionState(uint64_t display_id,
LayerComposition composition,
bool enable) = 0;
/**
* Set the expected time for the current frame to present on the display
*
* @param display_id: The id of the specified display
* @param expected_time: Expected present time in ns
*/
virtual DisplayError SetExpectedPresentTime(uint64_t display,
uint64_t expectedPresentTime) = 0;
/**
* Check if a frame buffer target(fbt) with the given configuration is
* supported by the hardware.
*
* @param display_id: The id of the specified display
* @param width: fbt width
* @param height: fbt height
* @param format: fbt format
* @param color_metadata: fbt color metadata
*
* @return: kErrorNone if the config is supported
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if one of the following conditions is met:
* - fbt format is not supported on the display
* - fbt width/height combo is not supported on the display
* - unsupported GammaTransfer or ColorPrimaries in fbt
* metadata
* - fbt color metadata requests an unsupported mode
*/
virtual DisplayError GetClientTargetSupport(uint64_t display_id,
int32_t in_width,
int32_t in_height,
LayerBufferFormat format,
Dataspace color_metadata) = 0;
/**
* Get a list of layer id's on the given display and their corresponding
* release fences.
*
* Since we can't return the actual fence impl, we will return the
* fence fd and the client can create their own fence using the fd.
*
* @param display_id: The id of the given display
*
* @return: parcel containing list of layer id's and their release fence.
* The layer id at slot layers[i] corresponds to the fence at
* fences[i]
*
* @exception: kErrorParameters if display_id is not found
*/
// QUESTION(JJ): Can we replace this format of out_num pointers with something
// more logical? Maybe vector<pair<LayerId, shared_ptr<Fence>>> so only need 1
// call seems like cleaner call flow to me
virtual DisplayError
GetReleaseFences(uint64_t display, uint32_t *out_num_elements,
LayerId *out_layers,
std::vector<shared_ptr<Fence>> *out_fences) = 0;
/**
* Enable or disable vsync on a given display
*
* @param display_id: The id of the given display
* @param enable: true to enable vsync, false to disable
*/
virtual DisplayError SetVsyncEnabled(uint64_t display_id, bool enable) = 0;
/**
* Set the output buffer for a virtual display
*
* @param display_id: The id of the specified display
* @param buffer: The buffer to be written to
* @param release_fence: Fence that represents when the buffer is safe to
* access
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display isn't virtual
*/
virtual DisplayError SetOutputBuffer(uint64_t display, const SnapHandle *buffer,
const shared_ptr<Fence> &release_fence) = 0;
virtual DisplayError GetVsyncPeriod(uint64_t display_id,
uint32_t *vsync_period) = 0;
virtual void Refresh(uint64_t display_id);
virtual DisplayError SetClientTarget(uint64_t display, const SnapHandle *target,
shared_ptr<Fence> acquire_fence, int32_t dataspace,
const SDMRegion& damage, uint32_t version) = 0;
virtual DisplayError CommitOrPrepare(uint64_t display, bool validate_only,
shared_ptr<Fence> *out_retire_fence,
uint32_t *out_num_types,
uint32_t *out_num_requests,
bool *needs_commit) = 0;
virtual DisplayError PresentDisplay(uint64_t display,
shared_ptr<Fence> *out_retire_fence) = 0;
virtual DisplayError GetChangedCompositionTypes(uint64_t display,
uint32_t *out_num_elements,
LayerId *out_layers,
int32_t *out_types) = 0;
virtual DisplayError GetDisplayRequests(uint64_t display,
int32_t *out_display_requests,
uint32_t *out_num_elements,
LayerId *out_layers,
int32_t *out_layer_requests) = 0;
virtual DisplayError SetDisplayElapseTime(uint64_t display,
uint64_t time) = 0;
virtual DisplayError AcceptDisplayChanges(uint64_t display) = 0;
virtual DisplayError GetActiveConfigIndex(uint64_t display,
uint32_t *config) = 0;
virtual DisplayError SetActiveConfigIndex(uint64_t display,
uint32_t config) = 0;
virtual DisplayError
MinHdcpEncryptionLevelChanged(uint64_t display, uint32_t min_enc_level) = 0;
virtual void LayerStackUpdated(uint64_t display) = 0;
virtual void WaitForDrawCycleToComplete(uint64_t display) = 0;
virtual DisplayError NotifyExpectedPresent(uint64_t display, uint64_t expected_present_time,
uint32_t frame_interval_ns) = 0;
virtual DisplayError SetFrameIntervalNs(uint64_t display, uint32_t frame_interval_ns) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_DRAWCYCLE_H__

View File

@@ -0,0 +1,134 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_LAYER_BUILDER_INTF_H__
#define __SDM_DISPLAY_LAYER_BUILDER_INTF_H__
#include <unordered_map>
#include <unordered_set>
#include <SnapHandle.h>
#include <core/buffer_allocator.h>
#include <core/sdm_types.h>
namespace sdm {
using SnapHandle = vendor::qti::hardware::display::snapalloc::SnapHandle;
class SDMDisplayLayerBuilderIntf {
public:
virtual ~SDMDisplayLayerBuilderIntf() {}
virtual DisplayError Init(BufferAllocator *buffer_allocator,
uint64_t display_id) = 0;
virtual DisplayError DeInit(uint64_t display_id) = 0;
virtual DisplayError CreateLayer(uint64_t display_id,
int64_t *out_layer_id) = 0;
virtual DisplayError DestroyLayer(uint64_t display_id, int64_t layer_id) = 0;
virtual DisplayError SetLayerBuffer(uint64_t display_id, int64_t layer_id, const SnapHandle *buffer,
const shared_ptr<Fence> &acquire_fence) = 0;
virtual DisplayError SetLayerBlendMode(uint64_t display_id, int64_t layer_id,
int32_t int_mode) = 0;
virtual DisplayError SetLayerDisplayFrame(uint64_t display_id,
int64_t layer_id,
SDMRect frame) = 0;
virtual DisplayError SetLayerPlaneAlpha(uint64_t display_id, int64_t layer_id,
float alpha) = 0;
virtual DisplayError SetLayerSourceCrop(uint64_t display_id, int64_t layer_id,
SDMRect crop) = 0;
virtual DisplayError SetLayerTransform(uint64_t display_id, int64_t layer_id,
SDMTransform transform) = 0;
virtual DisplayError SetLayerZOrder(uint64_t display_id, int64_t layer_id,
uint32_t z) = 0;
virtual DisplayError SetLayerType(uint64_t display_id, int64_t layer_id,
SDMLayerTypes type) = 0;
virtual DisplayError SetLayerFlag(uint64_t display_id, int64_t layer_id,
SDMLayerFlag flag) = 0;
virtual DisplayError SetLayerSurfaceDamage(uint64_t display_id,
int64_t layer_id,
SDMRegion damage) = 0;
virtual DisplayError SetLayerVisibleRegion(uint64_t display_id,
int64_t layer_id,
SDMRegion damage) = 0;
virtual DisplayError SetLayerCompositionType(uint64_t display_id,
int64_t layer_id,
int32_t int_type) = 0;
virtual DisplayError SetLayerColor(uint64_t display_id, int64_t layer_id,
SDMColor color) = 0;
virtual DisplayError SetLayerDataspace(uint64_t display_id, int64_t layer_id,
int32_t dataspace) = 0;
virtual DisplayError SetLayerPerFrameMetadata(uint64_t display_id,
int64_t layer_id,
uint32_t num_elements,
const int32_t *int_keys,
const float *metadata) = 0;
virtual DisplayError SetLayerColorTransform(uint64_t display_id,
int64_t layer_id,
const float *matrix) = 0;
virtual DisplayError
SetLayerPerFrameMetadataBlobs(uint64_t display_id, int64_t layer_id,
uint32_t num_elements, const int32_t *int_keys,
const uint32_t *sizes,
const uint8_t *metadata) = 0;
virtual DisplayError SetLayerBrightness(uint64_t display_id, int64_t layer_id,
float brightness) = 0;
virtual DisplayError SetLayerAsMask(uint64_t display_id,
int64_t layer_id) = 0;
virtual SDMCompositionType
GetDeviceSelectedCompositionType(uint64_t display_id, int64_t layer_id) = 0;
virtual DisplayError SetCursorPosition(uint64_t disp_id, int64_t layer_id,
int32_t x, int32_t y) = 0;
virtual LayerBufferFormat GetSDMFormat(const int32_t &source,
const int32_t flags,
const int64_t compression_type) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_LAYER_BUILDER_INTF_H__

View File

@@ -0,0 +1,153 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_LIFECYCLE_H__
#define __SDM_DISPLAY_INTF_LIFECYCLE_H__
#include <core/display_interface.h>
#include <core/socket_handler.h>
#include <utils/fence.h>
#include "debug_callback_intf.h"
#include "sdm_compositor_cb_intf.h"
#include "sdm_compositor_sideband_cb_intf.h"
using std::shared_ptr;
namespace sdm {
enum CompositorSyncType {
CompositorSyncTypeAcquire,
CompositorSyncTypeRelease,
};
class SDMDisplayLifeCycleIntf {
public:
SDMDisplayLifeCycleIntf() {}
virtual ~SDMDisplayLifeCycleIntf(){};
virtual void RegisterSideBandCallback(SDMSideBandCompositorCbIntf *cb,
bool enable) = 0;
virtual void RegisterCompositorCallback(SDMCompositorCbIntf *cb, bool enable) = 0;
/**
* Create and initialize a display with SDM
*
* For builtin displays: Query GetDisplayList immediately to determine if any
* builtin displays are connected, and initialize them afterwards.
*
* For external displays, call this after receiving a hotplug notification
*
* For virtual displays, compositor will call this in order to create the
* display
*
* @param display_id: The SDM id of the display to be created/initialized.
* This can be queried through GetDisplayList()
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError CreateDisplay(SDMDisplayType type, int32_t width,
int32_t height, int32_t *format,
uint64_t *display_id) = 0;
/**
* De-init and destroy a display with SDM
*
* For builtin/external: call this method after a hotplug disconnect is
* detected
*
* For virtual: Compositor calls this whenever the virtual display should be
* destroyed
*
* @param display_id: The SDM id of the display to be destroyed
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError DestroyDisplay(uint64_t display_id) = 0;
/**
* Get a list of currently connected displays, along with their display type,
* display id, and other display + panel info
*/
virtual DisplayError
GetDisplayList(std::vector<SDMDisplayInfo> *display_info) = 0;
/**
* Set the state of specified display
* In case of power off:
* - The display is off. In this state, there is nothing displayed on the
* screen.
*
* In case of power on:
* - The display is on. In this state, regular UI and application layers
* are visible.
*
* In case of doze:
* - The display is on but set to a low power state. In this state, only
* ambient information is displayed on the screen such as the time, weather,
* and notifications.
*
* In case of doze suspend:
* - The display is configured similar to doze mode but may stop applying
* updates on the display. In this state, the current contents will be
* displayed indefinitely until the power mode changes.
*
* @param display_id: The id of the specified display
* @param state: The state for the display to be set to
* @param teardown: Set this flag to force a full teardown on pluggable
* displays if requested state is OFF - no-op for other display types.
*
* @return: fd of the release fence
*
* @exception: kErrorParameters if display_id is not found
* @exception: NO_RESOURCES if the transition to requested state is deferred
* (can be deferred active secure session, pending CaptureFeedback teardown)
*/
virtual DisplayError SetDisplayState(uint64_t display_id, DisplayState state,
bool teardown, Fence *fence) = 0;
virtual DisplayError SetPowerMode(uint64_t display_id, int32_t int_mode) = 0;
virtual DisplayError Init(BufferAllocator *buffer_allocator,
SocketHandler *socket_handler,
DebugCallbackIntf *debug_handler) = 0;
virtual bool IsDisplayConnected(uint64_t display_id) = 0;
virtual DisplayError SetDisplayStatus(uint64_t disp_id,
SDMDisplayStatus status) = 0;
virtual DisplayError GetConfigCount(uint64_t disp_id, uint32_t *count) = 0;
virtual DisplayError TryDrawMethod(Display display,
DisplayDrawMethod drawMethod) = 0;
virtual void CompositorSync(CompositorSyncType syncType) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_LIFECYCLE_H__

View File

@@ -0,0 +1,51 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_PARCEL_INTF_H___
#define __SDM_PARCEL_INTF_H___
namespace sdm {
class SDMParcel {
public:
virtual ~SDMParcel() {}
virtual uint32_t readInt32() = 0;
virtual uint64_t readInt64() = 0;
virtual float readFloat() = 0;
virtual void writeInt32(uint32_t value) = 0;
virtual uint32_t dataSize() = 0;
virtual uint32_t writeFloat(float val) = 0;
virtual uint32_t dataPosition() = 0;
virtual uint32_t writeUint64(uint64_t value) = 0;
virtual uint32_t dataAvail() = 0;
virtual const void *readInplace(uint32_t size) = 0;
virtual uint32_t write(const void *data, uint32_t len) = 0;
virtual uint32_t writeDupFileDescriptor(int fd) = 0;
virtual double readDouble() = 0;
};
} // namespace sdm
#endif // __SDM_PARCEL_INTF_H__

View File

@@ -0,0 +1,454 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_SETTINGS_H__
#define __SDM_DISPLAY_INTF_SETTINGS_H__
#include <core/display_interface.h>
#include <core/sdm_types.h>
namespace sdm {
enum SDMDisplayCapability {
SDM_CAPS_SKIP_CLIENT_COLOR_TRANSFORM,
SDM_CAPS_DOZE,
SDM_CAPS_BRIGHTNESS,
SDM_CAPS_PROTECTED_CONTENTS,
};
/**
* The purpose of this interface is to set/get any configuration options that
* can be changed within a display's lifetime. So unlike display_caps, these
* values are not static and may be changed, whether that is driven internally
* or from a client call.
*/
class SDMDisplaySettingsIntf {
public:
virtual ~SDMDisplaySettingsIntf(){};
/**
* Set the backlight scale on the display (if applicable)
*
* @param display_id: The id of the specified display
* @param level: the level in int value to set BL level
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorParameters if the level provided is invalid for any
* reason
*/
virtual DisplayError SetBacklightScale(uint64_t display_id,
int32_t in_level) = 0;
/**
* Set the blend space on the given display
*
* @param display_id: The id of the specified display
* @param blend_space: ColorPrimaries containing blend space info
*
* @return: kErrorNone if transaction succeeded
*/
virtual DisplayError
SetBlendSpace(uint64_t display_id,
const PrimariesTransfer &in_blend_space) = 0;
/**
* Client can call this to enable/disable vsync on display.
* Default sate is disabled
*
* @param display_id: The id of the specified display
* @param enable: enabled vsync state
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError SetVSyncState(uint64_t display_id, bool in_enabled) = 0;
/**
* Set autorefresh flag on given display
*
* @param display_id: The id of the specified display
* @param enable: State of autorefresh
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError SetAutoRefresh(uint64_t display_id, bool in_enable) = 0;
/**
* Override NoisePlugIn parameters of the given device
*
* @param display_id: The id of the specified display
* @param override_en: enable flag for toggling override on/off
* @param attn: output attenuation factor
* @param noise_zpos: z-order position of noise layer
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorParameters if any of the given params are invalid
*/
virtual DisplayError SetNoisePlugInOverride(uint64_t display_id,
bool in_override_en,
int32_t in_attn,
int32_t in_noise_zpos) = 0;
/**
* Set the color mode on given display
*
* @param display_id: The id of the specified display
* @param color_mode: String form of the requested color mode
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError SetColorMode(uint64_t display_id,
const std::string &in_color_mode) = 0;
/**
* Set the variable vsync mode on a given display (if the display supports it)
*
* @param display_id: The id of the specified display
* @param vsync_mode: The mode of variable vync to be set
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn't support QSync
*/
virtual DisplayError
SetVariableVSyncMode(uint64_t display_id,
const VariableVSync &in_vsync_mode) = 0;
/**
* Set jitter configuration on given display (if the display supports it)
*
* @param display_id: The id of the specified display
* @param jitter_type: 0 - None, 1 - Instantaneous jitter, 2- Long term jitter
* @param value: max jitter value in percentage (0-10%)
* @param time: jitter time (for LTJ)
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn't support jitter
*/
virtual DisplayError SetJitterConfig(uint64_t display_id,
int32_t in_jitter_type, float in_value,
int32_t in_time) = 0;
/**
* Method to set min/max luminance for dynamic tonemapping of external device
* of WFD. Only supported on virtual displays.
*
* @param display_id: The id of the specified display
* @param min_lum: min luminance supported by external device
* @param max_lum: max luminance supported by external device
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError SetPanelLuminanceAttributes(uint64_t display_id,
float in_min_lum,
float in_max_lum) = 0;
/**
* Set the color mode with extended info
*
* @param display_id: The id of the specified display
* @param color_mode: Mode attributes which will be set
*
* @return kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn's support stc color
* mode
*/
virtual DisplayError
SetExtendedColorMode(uint64_t display_id,
const ColorModeInfo &in_color_mode) = 0;
/**
* Get the supported color modes with their info from the display
*
* @param display_id: The id of the specified display
*
* @return: List of color modes and their info
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetColorModes(uint64_t display_id,
uint32_t *out_num_modes,
int32_t *int_out_modes) = 0;
/**
* Method to enable/disable dimming on given display
*
* @param display_id: The id of the specified display
* @param int_enabled: 0- disable, >0- enable
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: UNDEFINED - something went wrong internally
*/
virtual DisplayError SetDimmingEnable(uint64_t display_id,
int32_t in_int_enabled) = 0;
/**
* Set minimal backlight value for diven display's dimming feature
*
* @param display_id: The id of the specified display
* @param min_bl: Min backlight value in int form
*
* @return: kErrorNone If transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: UNDEFINED if something went wrong internally (same as above)
*/
virtual DisplayError SetDimmingMinBacklight(uint64_t display_id,
int32_t in_min_bl) = 0;
/**
* Get the current brightness for a given display
* Only supported for builtin displays
*
* @param display_id: The id of the specified display
*
* @return: Display's brightness
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the given display doesn't support
* brightness levels
*/
virtual DisplayError GetPanelBrightness(uint64_t display_id, float *ret) = 0;
/**
* Set the brightness of the specified display
* Only supported for builtin displays
*
* @param display_id: The id of the specified display
* @param brightness: brightness from level 0.0f(min) to 1.0f(max) where -1.0f
* represents off
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorParameters if the brightness value is invalid
* @exception: kErrorNotSupported if the display doesn't support brightness
* levels
* @exception: kErrorResources if power state is pending, or if hw fails to write
* the new level
*/
virtual DisplayError SetPanelBrightness(uint64_t display_id,
float in_brightness) = 0;
/**
* Get the current refresh rate for the given display
*
* @param display_id: The id of the specified display
*
* @return: int value of current refresh rate
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetRefreshRate(uint64_t display_id, int32_t *ret) = 0;
/**
* Set new refresh rate on the given display.
* Not supported on virtual displays.
*
* @param display_id: The id of the specified display
* @param refresh_rate: new refresh rate of the display
* @param final_rate: indicates whether refresh rate is final rate or can be
* changed by sdm
* @param idle_screen: indicates whether screen is idle. Used to be false by
* default, now needs to be explicitly declared
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display doesn't support refresh rate
* changes (virtual display, inactive display, panel doesn't support dynamic
* fps, QSync active, or bit clock rate update pending)
* @exception: kErrorParameters if the fps is below display's min
* supported/above max supported fps.
*/
virtual DisplayError SetRefreshRate(uint64_t display_id,
int32_t in_refresh_rate,
bool in_final_rate,
bool in_idle_screen) = 0;
/**
* Set active configuration for variable properties of the display device
* using DisplayConfigVariableInfo.
* Currently only supported for virtual displays, since we have to re-register
* the display with the new DisplayConfigVariableInfo
*
* @param display_id: The id of the specified display
* @param variable_info: Config info to be set as active
*
* @return: kErrorNone if transaction succeeded
*
* @exception: kErrorParameters if display_id is not found
* @exception: kErrorNotSupported if the display is not virtual
* @exception: NO_RESOURCES if there are currently no resources to make the
* change
*/
virtual DisplayError SetActiveConfig(uint64_t display_id, int32_t config) = 0;
/**
* Get the index of the active configuration on the given display
* For virtual displays, this will always be 0 as they don't have multiple
* configuration options.
*
* @param display_id: variable_info
*
* @return: index of active configuration
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetActiveConfig(uint64_t display_id, Config *ret) = 0;
virtual DisplayError GetAllDisplayAttributes(
uint64_t display_id,
std::map<uint32_t, DisplayConfigVariableInfo> *info) = 0;
virtual DisplayError GetDisplayAttributes(uint64_t display_id,
int32_t in_index,
DisplayConfigVariableInfo *ret) = 0;
/**
* Get the VSync event state. The default state is disabled
*
* @param display_id: The id of the specified display
*
* @return: true if VSync state is enabled
*
* @exception: kErrorParameters if display_id is not found
*/
virtual DisplayError GetVSyncState(uint64_t display_id, bool *ret) = 0;
virtual DisplayError GetDataspaceSaturationMatrix(int32_t dataspace,
float *out_matrix) = 0;
virtual DisplayError
GetDisplayVsyncPeriod(uint64_t display,
VsyncPeriodNanos *out_vsync_period) = 0;
virtual DisplayError GetReadbackBufferAttributes(uint64_t display,
int32_t *format,
int32_t *dataspace) = 0;
virtual DisplayError GetRenderIntents(uint64_t display, int32_t color_mode,
uint32_t *out_num_intents,
int32_t *int_out_intents) = 0;
virtual DisplayError
GetReadbackBufferFence(uint64_t display,
shared_ptr<Fence> *release_fence) = 0;
virtual DisplayError SetColorModeWithRenderIntent(uint64_t display,
int32_t mode,
int32_t intent) = 0;
virtual DisplayError
SetReadbackBuffer(uint64_t display, void *buffer,
const shared_ptr<Fence> &acquire_fence) = 0;
virtual DisplayError SetColorTransform(uint64_t display,
const std::vector<float> &matrix) = 0;
virtual DisplayError SetDisplayBrightness(Display display,
float brightness) = 0;
virtual DisplayError SetCursorPosition(Display display, LayerId layer,
int32_t x, int32_t y) = 0;
virtual DisplayError GetDisplayName(Display display, uint32_t *out_size,
char *out_name) = 0;
virtual DisplayError getDisplayDecorationSupport(Display display,
uint32_t *format,
uint32_t *alpha) = 0;
virtual DisplayError SetActiveConfigWithConstraints(
Display display, Config config,
const SDMVsyncPeriodChangeConstraints *vsync_period_change_constraints,
SDMVsyncPeriodChangeTimeline *out_timeline) = 0;
virtual DisplayError
GetClientTargetProperty(Display display,
SDMClientTargetProperty *outClientTargetProperty) = 0;
virtual bool IsHDRDisplay(uint64_t display) = 0;
virtual DisplayError ConfigureDynRefreshRate(SDMBuiltInDisplayOps ops,
int refresh_rate) = 0;
virtual DisplayError GetDisplayBrightness(uint64_t display,
float *brightness) = 0;
virtual DisplayError ControlPartialUpdate(uint64_t disp_id, bool enable) = 0;
virtual DisplayError ToggleScreenUpdate(bool on) = 0;
virtual DisplayError SetIdleTimeout(uint32_t value) = 0;
virtual DisplayError SetDisplayDppsAdROI(uint64_t display_id,
uint32_t h_start, uint32_t h_end,
uint32_t v_start, uint32_t v_end,
uint32_t factor_in,
uint32_t factor_out) = 0;
virtual void UpdateVSyncSourceOnPowerModeOff() = 0;
virtual void UpdateVSyncSourceOnPowerModeDoze() = 0;
virtual DisplayError GetDSIClk(uint64_t disp_id, uint64_t *bit_clk) = 0;
virtual DisplayError SetDSIClk(uint64_t disp_id, uint64_t bit_clk) = 0;
virtual DisplayError SetQsyncMode(uint64_t disp_id, QSyncMode mode) = 0;
virtual DisplayError GetActiveBuiltinDisplay(uint64_t *disp_id) = 0;
virtual int GetDisplayConfigGroup(uint64_t display, DisplayConfigGroupInfo variable_config) = 0;
virtual DisplayError SetupVRRConfig(uint64_t display_id) = 0;
virtual int GetNotifyEptConfig(uint64_t display) = 0;
virtual DisplayError PerformCacConfig(uint64_t disp_id, CacConfig cac_config, bool enable) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_SETTINGS_H__

View File

@@ -0,0 +1,82 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTF_SIDEBAND_H__
#define __SDM_DISPLAY_INTF_SIDEBAND_H__
#include <core/sdm_types.h>
#include <core/layer_buffer.h>
#include "sdm_display_intf_parcel.h"
namespace sdm {
class SDMDisplaySideBandIntf {
public:
virtual ~SDMDisplaySideBandIntf() {}
virtual DisplayError SetCameraLaunchStatus(uint32_t on) = 0;
virtual DisplayError DisplayBWTransactionPending(bool *status) = 0;
virtual DisplayError SetDisplayAnimating(uint64_t display_id,
bool animating) = 0;
virtual DisplayError ControlIdlePowerCollapse(bool enable,
bool synchronous) = 0;
virtual void SetClientUp() = 0;
virtual bool IsBuiltInDisplay(uint64_t display) = 0;
virtual bool IsAsyncVDSCreationSupported() = 0;
virtual DisplayError CreateVirtualDisplay(int32_t width, int32_t height,
int32_t format) = 0;
virtual DisplayError TUIEventHandler(uint64_t display,
SDMTUIEventType event_type) = 0;
virtual DisplayError SetCameraSmoothInfo(SDMCameraSmoothOp op,
int32_t fps) = 0;
virtual DisplayError SetContentFps(const std::string& name, int32_t fps) = 0;
virtual DisplayError PostBuffer(const CwbConfig &cwb_config, void *buffer,
int32_t display_type) = 0;
virtual int GetProperty(const char *property_name, char *value) = 0;
virtual int GetProperty(const char *property_name, int *value) = 0;
virtual void Dump(uint32_t *out_size, char *out_buffer) = 0;
virtual DisplayError NotifyCallback(uint32_t command, SDMParcel *input_parcel,
SDMParcel *output_parcel) = 0;
};
} // namespace sdm
#endif // __SDM_DISPLAY_INTF_SIDEBAND_H__

View File

@@ -0,0 +1,56 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Changes from Qualcomm Innovation Center, Inc. are provided under the following license:
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __SDM_DISPLAY_INTERFACE_FACTORY_H__
#define __SDM_DISPLAY_INTERFACE_FACTORY_H__
#include "sdm_display_intf_aiqe.h"
#include "sdm_display_intf_caps.h"
#include "sdm_display_intf_drawcycle.h"
#include "sdm_display_intf_layer_builder.h"
#include "sdm_display_intf_lifecycle.h"
#include "sdm_display_intf_settings.h"
#include "sdm_display_intf_sideband.h"
namespace sdm {
class SDMInterfaceFactory {
public:
virtual ~SDMInterfaceFactory() {}
virtual std::shared_ptr<SDMDisplayCapsIntf> CreateCapsIntf() = 0;
virtual std::shared_ptr<SDMDisplayDrawCycleIntf> CreateDrawCycleIntf() = 0;
virtual std::shared_ptr<SDMDisplayLayerBuilderIntf>
CreateLayerBuilderIntf() = 0;
virtual std::shared_ptr<SDMDisplayLifeCycleIntf> CreateLifeCycleIntf() = 0;
virtual std::shared_ptr<SDMDisplaySettingsIntf> CreateSettingsIntf() = 0;
virtual std::shared_ptr<SDMDisplaySideBandIntf> CreateSideBandIntf() = 0;
virtual std::shared_ptr<SDMDisplayAiqeIntf> CreateAiqeIntf() = 0;
};
SDMInterfaceFactory *GetSDMInterfaceFactory();
} // namespace sdm
#endif // __SDM_DISPLAY_INTERFACE_FACTORY_H__