display: Add frame scheduler interface
- Add frame scheduler interface. - Add version for composer extension interface. Change-Id: Ic00d30a8fffc8d73888c4e1bc82312920f2bb284
This commit is contained in:
@@ -31,10 +31,19 @@
|
|||||||
#define __COMPOSER_EXTN_INTF_H__
|
#define __COMPOSER_EXTN_INTF_H__
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
#include "frame_scheduler_intf.h"
|
||||||
|
|
||||||
|
#define COMPOSER_EXTN_REV_MAJOR (1)
|
||||||
|
#define COMPOSER_EXTN_REV_MINOR (0)
|
||||||
|
#define COMPOSER_EXTN_VERSION_TAG ((uint16_t) ((COMPOSER_EXTN_REV_MAJOR << 8) \
|
||||||
|
| COMPOSER_EXTN_REV_MINOR))
|
||||||
|
|
||||||
namespace composer {
|
namespace composer {
|
||||||
|
|
||||||
class ComposerExtnIntf {
|
class ComposerExtnIntf {
|
||||||
|
public:
|
||||||
|
virtual int CreateFrameScheduler(FrameSchedulerIntf **intf) = 0;
|
||||||
|
virtual void DestroyFrameScheduler(FrameSchedulerIntf *intf) = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual ~ComposerExtnIntf() { }
|
virtual ~ComposerExtnIntf() { }
|
||||||
};
|
};
|
||||||
@@ -48,8 +57,8 @@ class ComposerExtnLib {
|
|||||||
private:
|
private:
|
||||||
const char *lib_name = "libcomposerextn.qti.so";
|
const char *lib_name = "libcomposerextn.qti.so";
|
||||||
|
|
||||||
typedef int (*CreateComposerExtnIntf)(ComposerExtnIntf **intf);
|
typedef int (*CreateComposerExtn)(uint16_t version, ComposerExtnIntf **intf);
|
||||||
typedef void (*DestroyComposerExtnIntf)(ComposerExtnIntf *intf);
|
typedef void (*DestroyComposerExtn)(ComposerExtnIntf *intf);
|
||||||
|
|
||||||
ComposerExtnLib() {
|
ComposerExtnLib() {
|
||||||
lib_obj_ = ::dlopen(lib_name, RTLD_NOW);
|
lib_obj_ = ::dlopen(lib_name, RTLD_NOW);
|
||||||
@@ -57,18 +66,18 @@ class ComposerExtnLib {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_composer_ext_intf_ = reinterpret_cast<CreateComposerExtnIntf>(
|
create_composer_ext_fn_ = reinterpret_cast<CreateComposerExtn>(
|
||||||
::dlsym(lib_obj_, "CreateComposerExtnIntf"));
|
::dlsym(lib_obj_, "CreateComposerExtn"));
|
||||||
destroy_composer_ext_intf_ = reinterpret_cast<DestroyComposerExtnIntf>(
|
destroy_composer_ext_fn_ = reinterpret_cast<DestroyComposerExtn>(
|
||||||
::dlsym(lib_obj_, "DestroyComposerExtnIntf"));
|
::dlsym(lib_obj_, "DestroyComposerExtn"));
|
||||||
if (create_composer_ext_intf_ && destroy_composer_ext_intf_) {
|
if (create_composer_ext_fn_ && destroy_composer_ext_fn_) {
|
||||||
create_composer_ext_intf_(&composer_ext_intf_);
|
create_composer_ext_fn_(COMPOSER_EXTN_VERSION_TAG, &composer_ext_intf_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~ComposerExtnLib() {
|
~ComposerExtnLib() {
|
||||||
if (composer_ext_intf_) {
|
if (composer_ext_intf_) {
|
||||||
destroy_composer_ext_intf_(composer_ext_intf_);
|
destroy_composer_ext_fn_(composer_ext_intf_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lib_obj_) {
|
if (lib_obj_) {
|
||||||
@@ -78,8 +87,8 @@ class ComposerExtnLib {
|
|||||||
|
|
||||||
static ComposerExtnLib g_composer_ext_lib_;
|
static ComposerExtnLib g_composer_ext_lib_;
|
||||||
void *lib_obj_ = nullptr;
|
void *lib_obj_ = nullptr;
|
||||||
CreateComposerExtnIntf create_composer_ext_intf_ = nullptr;
|
CreateComposerExtn create_composer_ext_fn_ = nullptr;
|
||||||
DestroyComposerExtnIntf destroy_composer_ext_intf_ = nullptr;
|
DestroyComposerExtn destroy_composer_ext_fn_ = nullptr;
|
||||||
ComposerExtnIntf *composer_ext_intf_ = nullptr;
|
ComposerExtnIntf *composer_ext_intf_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
44
include/frame_scheduler_intf.h
Normal file
44
include/frame_scheduler_intf.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, 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 __FRAME_SCHEDULER_INTF_H__
|
||||||
|
#define __FRAME_SCHEDULER_INTF_H__
|
||||||
|
|
||||||
|
namespace composer {
|
||||||
|
|
||||||
|
class FrameSchedulerIntf {
|
||||||
|
public:
|
||||||
|
virtual int UpdateFrame() = 0;
|
||||||
|
protected:
|
||||||
|
virtual ~FrameSchedulerIntf() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace composer
|
||||||
|
|
||||||
|
#endif // __FRAME_SCHEDULER_INTF_H__
|
||||||
Reference in New Issue
Block a user