hwc: Change default app buffers count for ferrum.
Set application buffer count to "2" based on *RAM size(512 and below) *Screen Resolution(qHd and below) Change-Id: I40a6c5f93611e7122b038767d49b3b6344a1d715
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
#include "comptype.h"
|
#include "comptype.h"
|
||||||
#include "hwc_virtual.h"
|
#include "hwc_virtual.h"
|
||||||
#include "qd_utils.h"
|
#include "qd_utils.h"
|
||||||
|
#include <sys/sysinfo.h>
|
||||||
|
|
||||||
using namespace qClient;
|
using namespace qClient;
|
||||||
using namespace qService;
|
using namespace qService;
|
||||||
@@ -73,6 +74,11 @@ EGLAPI EGLBoolean eglGpuPerfHintQCOM(EGLDisplay dpy, EGLContext ctx,
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define PROP_DEFAULT_APPBUFFER "ro.sf.default_app_buffer"
|
||||||
|
#define MAX_RAM_SIZE 512*1024*1024
|
||||||
|
#define qHD_WIDTH 540
|
||||||
|
|
||||||
|
|
||||||
namespace qhwc {
|
namespace qhwc {
|
||||||
|
|
||||||
//Std refresh rates for digital videos- 24p, 30p and 48p
|
//Std refresh rates for digital videos- 24p, 30p and 48p
|
||||||
@@ -232,6 +238,25 @@ static int openFramebufferDevice(hwc_context_t *ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void changeDefaultAppBufferCount() {
|
||||||
|
struct sysinfo info;
|
||||||
|
unsigned long int ramSize = 0;
|
||||||
|
if (!sysinfo(&info)) {
|
||||||
|
ramSize = info.totalram ;
|
||||||
|
}
|
||||||
|
int fb_fd = -1;
|
||||||
|
struct fb_var_screeninfo sInfo ={0};
|
||||||
|
fb_fd = open("/dev/graphics/fb0", O_RDONLY);
|
||||||
|
if (fb_fd >=0) {
|
||||||
|
ioctl(fb_fd, FBIOGET_VSCREENINFO, &sInfo);
|
||||||
|
close(fb_fd);
|
||||||
|
}
|
||||||
|
if ((ramSize && ramSize < MAX_RAM_SIZE) &&
|
||||||
|
(sInfo.xres && sInfo.xres <= qHD_WIDTH )) {
|
||||||
|
property_set(PROP_DEFAULT_APPBUFFER, "2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void initContext(hwc_context_t *ctx)
|
void initContext(hwc_context_t *ctx)
|
||||||
{
|
{
|
||||||
openFramebufferDevice(ctx);
|
openFramebufferDevice(ctx);
|
||||||
@@ -243,6 +268,10 @@ void initContext(hwc_context_t *ctx)
|
|||||||
ctx->mOverlay = overlay::Overlay::getInstance();
|
ctx->mOverlay = overlay::Overlay::getInstance();
|
||||||
ctx->mRotMgr = RotMgr::getInstance();
|
ctx->mRotMgr = RotMgr::getInstance();
|
||||||
|
|
||||||
|
//default_app_buffer for ferrum
|
||||||
|
if (ctx->mMDP.version == qdutils::MDP_V3_0_5) {
|
||||||
|
changeDefaultAppBufferCount();
|
||||||
|
}
|
||||||
// Initialize composition objects for the primary display
|
// Initialize composition objects for the primary display
|
||||||
initCompositionResources(ctx, HWC_DISPLAY_PRIMARY);
|
initCompositionResources(ctx, HWC_DISPLAY_PRIMARY);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user