surfaceflinger中多个virtualdisplay导致屏幕闪烁

giszxl 2018-02-09 07:24:02
最近遇到了屏幕闪烁的问题,发现如果surfaceflinger有多个virtualdisplay的话,在高刷新率的页面上很容易出现屏幕闪烁的问题。请问大家有没有遇到过同样的问题,以及造成该现象的根本原因。下面是相关log信息。

dumpsys SurfaceFlinger info:

Displays (3 entries)
+ DisplayDevice: NdkMediaCodec
type=2, hwcId=2, layerStack=0, (1024x 480), ANativeWindow=0xb1fff808, orient= 0 (type=00000000), flips=1553, isSecure=1, powerMode=2, activeConfig=0, numLayers=3
v:[0,0,1024,480], f:[0,0,1024,480], s:[0,0,1024,480],transform:[[1.000,0.000,-0.000][0.000,1.000,-0.000][0.000,0.000,1.000]]
+ DisplayDevice: NdkMediaCodec
type=2, hwcId=-12, layerStack=0, (1024x 480), ANativeWindow=0xa7f72008, orient= 0 (type=00000000), flips=594, isSecure=1, powerMode=2, activeConfig=0, numLayers=3
v:[0,0,1024,480], f:[0,0,1024,480], s:[0,0,1024,480],transform:[[1.000,0.000,-0.000][0.000,1.000,-0.000][0.000,0.000,1.000]]
+ DisplayDevice: Built-in Screen
type=0, hwcId=0, layerStack=0, (1024x 480), ANativeWindow=0xb1fff008, orient= 0 (type=00000000), flips=4251, isSecure=1, powerMode=2, activeConfig=0, numLayers=3
v:[0,0,1024,480], f:[0,0,1024,480], s:[0,0,1024,480],transform:[[1.000,0.000,-0.000][0.000,1.000,-0.000][0.000,0.000,1.000]]
mAbandoned=0

h/w composer state:
h/w composer present and enabled
Hardware Composer state (version 01030000):
mDebugForceFakeVSync=0
Display[0] configurations (* current):
* 0: 1024x480, xdpi=159.567993, ydpi=160.421005, refresh=16949152, colorMode=0
numHwLayers=4, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | a817fd00 | 0000 | 0000 | 00 | 0100 | RGB_565 | 0.0, 0.0, 909.0, 480.0 | 0, 0, 909, 480 | SurfaceView - com.autonavi.amapauto/com.autonavi.amapauto.MainMapActivity
HWC | a817f940 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 909.0, 480.0 | 0, 0, 909, 480 | com.autonavi.amapauto/com.autonavi.amapauto.MainMapActivity
HWC | a817e080 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 115.0, 480.0 | 909, 0, 1024, 480 |
FB TARGET | b1fc3c00 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1024.0, 480.0 | 0, 0, 1024, 480 | HWC_FRAMEBUFFER_TARGET
Display[2] configurations (* current):
* 0: 1024x480, xdpi=213.000000, ydpi=213.000000, refresh=4294967040, colorMode=0
numHwLayers=4, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | a817fd00 | 0000 | 0000 | 00 | 0100 | RGB_565 | 0.0, 0.0, 909.0, 480.0 | 0, 0, 909, 480 | SurfaceView - com.autonavi.amapauto/com.autonavi.amapauto.MainMapActivity
HWC | a817f940 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 909.0, 480.0 | 0, 0, 909, 480 | com.autonavi.amapauto/com.autonavi.amapauto.MainMapActivity
HWC | a817e080 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 115.0, 480.0 | 909, 0, 1024, 480 |
FB TARGET | a817fa00 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1024.0, 480.0 | 0, 0, 1024, 480 | HWC_FRAMEBUFFER_TARGET


Total allocated (estimate): 21729.00 KB
...全文
2343 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaohuh421 2018-02-13
  • 打赏
  • 举报
回复
一般闪烁, 根本原因就是由于人眼的停留效应导致的. 那么什么时候为触发这种停留效应呢? 答案就是图像变化太剧烈了. 所以你的闪烁就是两个画面可能是由于背景刷新时间与背景刷新时间之间,间隔太长, 导致看到白屏或者黑屏闪烁. 或者你的多个virtualdisplay之间切换的时候, 时间太长.

80,360

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧