Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5fa305a authored by Lajos Molnar's avatar Lajos Molnar
Browse files

C2Config: define C2PlatformConfig::resource_id_t

This enum is used to define platform-specific resource
IDs and the start index of vendor-defined values.

Bug: 363282971
Change-Id: I8d71c21f4c8aca14a1e8bcd2fc71d8b81368095f
Test: build
Flags: EXEMPT definition
parent ff7b3ac4
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ struct C2Config {

struct C2PlatformConfig {
    enum encoding_quality_level_t : uint32_t; ///< encoding quality level
    enum resource_id_t : uint32_t;          ///< resource IDs defined by the platform
    enum tunnel_peek_mode_t: uint32_t;      ///< tunnel peek mode
};

@@ -1290,7 +1291,10 @@ C2ENUM(C2Config::resource_kind_t, uint32_t,
 * They represent any physical or abstract entities of limited availability
 * that is required for a component instance to execute and process work.
 *
 * Each defined resource has an id.
 * Each defined resource has an id. In general, the id is defined by the vendor,
 * but the platform also defines a limited set of IDs. Vendor IDs SHALL start
 * from C2PlatformConfig::resource_id_t::VENDOR_START.
 *
 * The use of a resource is specified by the amount and the kind (e.g. whether the amount
 * of resources is required for each frame processed, or whether they are required
 * regardless of the processing rate (const amount)).
@@ -1306,7 +1310,7 @@ struct C2SystemResourceStruct {
                           uint64_t amount_)
        : id(id_), kind(kind_), amount(amount_) { }
    C2SystemResourceStruct() : C2SystemResourceStruct(0, CONST, 0) {}
    uint32_t id;
    uint32_t id;            ///< resource ID (see C2PlatformConfig::resource_id_t)
    C2Config::resource_kind_t kind;
    uint64_t amount;

@@ -2490,6 +2494,16 @@ typedef C2GlobalParam<C2Setting, C2SimpleValueStruct<C2Config::platform_feature_
        C2PlatformFeaturesSetting;
constexpr char C2_PARAMKEY_PLATFORM_FEATURES[] = "api.platform-features";

/**
 * Resource IDs
 */
enum C2PlatformConfig::resource_id_t : uint32_t {
    DMABUF_MEMORY = 16,  ///< memory allocated from a platform allocator (dmabuf or gralloc)

    /// vendor defined resource IDs start from here
    VENDOR_START = 0x1000,
};

/**
 * This structure describes the preferred ion allocation parameters for a given memory usage.
 */