rockchip: drmhwc2: limit framebuffer for low-ram device

Signed-off-by: hmz007 <hmz007@gmail.com>
master
hmz007 9 months ago
parent 1c2482d6ec
commit 0451d8ea5b

@ -1367,12 +1367,19 @@ HWC2::Error DrmHwcTwo::HwcDisplay::GetDisplayConfigs(uint32_t *num_configs,
* RK3588/RK3576Limit to 4096x2160 if large than 2160p
* Other: Limit to 1920x1080 if large than 2160p
*/
if(isRK3588(resource_manager_->getSocId()) || isRK3576(resource_manager_->getSocId())){
bool low_ram_device = property_get_bool("ro.config.low_ram", false);
if (low_ram_device) {
if (ctx_.framebuffer_height >= 2160 && ctx_.framebuffer_width >= ctx_.framebuffer_height) {
HWC2_ALOGD_IF_DEBUG("Limit framebuffer for low-ram device");
ctx_.framebuffer_width >>= 1;
ctx_.framebuffer_height >>= 1;
}
} else if (isRK3588(resource_manager_->getSocId()) || isRK3576(resource_manager_->getSocId())) {
if (ctx_.framebuffer_height >= 2160 && ctx_.framebuffer_width >= ctx_.framebuffer_height) {
ctx_.framebuffer_width = ctx_.framebuffer_width * (2160.0 / ctx_.framebuffer_height);
ctx_.framebuffer_height = 2160;
}
}else{
} else {
if (ctx_.framebuffer_height >= 2160 && ctx_.framebuffer_width >= ctx_.framebuffer_height) {
ctx_.framebuffer_width = ctx_.framebuffer_width * (1080.0 / ctx_.framebuffer_height);
ctx_.framebuffer_height = 1080;

Loading…
Cancel
Save