diff --git a/hardware/rockchip/hwcomposer/drmhwc2/drmhwctwo.cpp b/hardware/rockchip/hwcomposer/drmhwc2/drmhwctwo.cpp index 04f85480f55..1b1dea4c8c7 100755 --- a/hardware/rockchip/hwcomposer/drmhwc2/drmhwctwo.cpp +++ b/hardware/rockchip/hwcomposer/drmhwc2/drmhwctwo.cpp @@ -1367,12 +1367,19 @@ HWC2::Error DrmHwcTwo::HwcDisplay::GetDisplayConfigs(uint32_t *num_configs, * RK3588/RK3576:Limit 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;