I am facing the same issue.
I have a HDMI monitor with 1920x1920 resolution and plug into Jetson TK1,
but when I run Android on Jetson TK1 the screen is output with 1920x1080 resolution.
I type adb logcat and see the hwcomposer log with edid info:
D/hwcomposer( 140): hdmi_primary set to: 1
D/hwcomposer( 140): cursor_enable set to: 1
D/hwcomposer( 140): didim_enable set to: 1
D/hwcomposer( 140): didim_normal set to: 3
D/hwcomposer( 140): didim_video set to: 5
W/hwcomposer( 140): Invalid display_resolution property: ""
D/hwcomposer( 140): HDMI preferred resolution set to: Max_60Hz
D/hwcomposer( 140): Compositor set to: glcomposer
D/hwcomposer( 140): Composite policy set to: auto
D/hwcomposer( 140): composite_fallback set to: 1
D/hwcomposer( 140): Overriding minimum_fps, new value = 8
D/hwcomposer( 140): imp_enable set to: 1
D/hwcomposer( 140): void nvfb_event_process_pipe(void*): processing pipe fd
E/hwcomposer( 140): failed to enumerate adf devices: Success
D/hwcomposer( 140): Using DC driver
D/hwcomposer( 140): void nvfb_event_process_pipe(void*): processing pipe fd
D/hwcomposer( 140): Display 0: found 1 modes
D/hwcomposer( 140): display type 0: vblank period = 16671166 ns
D/hwcomposer( 140): virtual int dc_display::set_blank(int): display 0, [1 -> 1]
D/hwcomposer( 140): Display 1: found 18 modes
D/hwcomposer( 140): unmatched: 1920 x 1920 @ 59.96 Hz
D/hwcomposer( 140): unmatched: 1920 x 1920 @ 29.94 Hz
D/hwcomposer( 140): unmatched: 720 x 400 @ 70.05 Hz
D/hwcomposer( 140): matched: 640 x 480 @ 60.00 Hz
D/hwcomposer( 140): unmatched: 800 x 600 @ 60.32 Hz
D/hwcomposer( 140): unmatched: 1024 x 768 @ 60.01 Hz
D/hwcomposer( 140): unmatched: 1920 x 1200 @ 60.00 Hz
D/hwcomposer( 140): matched: 1920 x 1080 @ 60.00 Hz
D/hwcomposer( 140): unmatched: 1600 x 1200 @ 60.01 Hz
D/hwcomposer( 140): unmatched: 1600 x 900 @ 59.99 Hz
D/hwcomposer( 140): unmatched: 1280 x 1024 @ 60.02 Hz
D/hwcomposer( 140): unmatched: 1280 x 960 @ 60.00 Hz
D/hwcomposer( 140): matched: 1280 x 720 @ 59.67 Hz
D/hwcomposer( 140): unmatched: 2048 x 2048 @ 59.43 Hz
D/hwcomposer( 140): matched: 1920 x 1080 @ 60.00 Hz
D/hwcomposer( 140): matched: 1280 x 720 @ 60.00 Hz
D/hwcomposer( 140): matched: 720 x 480 @ 59.94 Hz
D/hwcomposer( 140): unmatched: 640 x 480 @ 61.05 Hz
D/hwcomposer( 140): display type 1: vblank period = 16666650 ns
E/hwcomposer( 140): HDCP: hdcp_open failed, error 1
D/hwcomposer( 140): Setting vblank display to Internal, new vblank period 16666650 ns
D/hwcomposer( 140): display type 2: vblank period = 0 ns
W/hwcomposer( 140): failed to load libnvcap_video.so: dlopen failed: library "libnvcap_video.so" not found
D/hwcomposer( 140): Display 0 layer size is 1920 x 1080
D/hwcomposer( 140): Display 0 device size is 1920 x 1080
D/hwcomposer( 140): Display 0 device clip is (0, 0, 1920, 1080)
D/hwcomposer( 140): config[0].x = 1920
D/hwcomposer( 140): config[0].y = 1080
D/hwcomposer( 140): int hwc_blank(hwc_composer_device_1*, int, int): display 0: unblank
D/hwcomposer( 140): void hwc_blank_display(nvhwc_context*, int, int): display 0: [1 -> 0]
D/hwcomposer( 140): Display 0 device size is 1920 x 1080
D/hwcomposer( 140): Display 0 device clip is (0, 0, 1920, 1080)
D/hwcomposer( 140): virtual int dc_display::set_blank(int): display 1, [1 -> 0]
The log shows the monitor supports 1920x1920 resolution, but there is a “unmatched” log but I don’t understand what it means.
And there is another problem that the Android SurfaceFlinger only render the 1920x1080 buffer:
h/w composer state:
h/w composer present and enabled
Hardware Composer state (version 01030000):
mDebugForceFakeVSync=0
Display[0] configurations (* current):
* 0: 1920x1080, xdpi=320.000000, ydpi=320.000000, refresh=16666650
numHwLayers=6, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | b6317f00 | 0000 | 0000 | 00 | 0100 | RGBA_8888 | 0.0, 125.0, 1920.0, 1132.0 | 0, 25, 1920, 1032 | com.android.systemui.ImageWallpaper
HWC | b3f633c0 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 25.0, 1920.0, 1032.0 | 0, 25, 1920, 1032 | com.android.launcher/com.android.launcher2.Launcher
HWC | b2314c80 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 25.0 | 0, 0, 1920, 25 | StatusBar
HWC | b23148c0 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 48.0 | 0, 1032, 1920, 1080 | NavigationBar
HWC | b34c6940 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 22.0, 28.0 | 1007, 754, 1029, 782 | Sprite
FB TARGET | b4dcf400 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 1080.0 | 0, 0, 1920, 1080 | HWC_FRAMEBUFFER_TARGET
Nvidia HWC:
Display 0 (PRIMARY):
Resolution: 1920 x 1080
Blank: false
Protected: false
Compositor: glcomposer
Composition: 5 layers in a scratch buffer
Window 0 (phys 2 caps 63): unused
Window 1 (phys 1 caps 63): unused
Window 2 (phys 0 caps 99 blend 0x105 xform 0x0): scratch containing 5 layers
src (0.0,0.0,1920.0,1080.0), dst (0.0,0.0,1920.0,1080.0)
Cursor (max 256): unused
Display 1 (EXTERNAL):
disabled
Composite policy: auto
Idle machine: detection enabled, composite enabled
Allocated buffers:
0xb2314780: 360.00 KiB | 1920 (1920) x 48 | 1 | 0x00000b00
0xb23148c0: 360.00 KiB | 1920 (1920) x 48 | 1 | 0x00000b00
0xb2314c80: 187.50 KiB | 1920 (1920) x 25 | 1 | 0x00000b00
0xb34c4280: 7740.00 KiB | 1920 (1920) x 1032 | 1 | 0x00000b00
0xb34c4780: 7740.00 KiB | 1920 (1920) x 1032 | 1 | 0x00000b00
0xb34c6940: 7.00 KiB | 22 ( 64) x 28 | 1 | 0x00008933
0xb34c6bc0: 360.00 KiB | 1920 (1920) x 48 | 1 | 0x00000b00
0xb3f633c0: 7740.00 KiB | 1920 (1920) x 1032 | 1 | 0x00000b00
0xb3ff9d40: 187.50 KiB | 1920 (1920) x 25 | 1 | 0x00000b00
0xb3ff9e80: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00001a00
0xb4dcf400: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00001a00
0xb6317500: 0.25 KiB | 1 ( 64) x 1 | 1 | 0x00000933
0xb6317780: 187.50 KiB | 1920 (1920) x 25 | 1 | 0x00000b00
0xb6317f00: 9600.00 KiB | 1920 (1920) x 1280 | 1 | 0x00000b00
0xb652a3c0: 8100.00 KiB | 1920 (1920) x 1080 | 1 | 0x00000933
Total allocated (estimate): 58769.75 KB
Nvidia Gralloc
Compression: on
Decompression: lazy
GPU mapping cache: on
Continuous property scan: off
After I google this problem in the internet, I found a system property called “persist.sys.display.resolution” can adjust the SurfaceFlinger buffer size.
I set this property to 1920x1920 and rebuild and run Android. The logcat shows:
D/hwcomposer( 138): hdmi_primary set to: 1
D/hwcomposer( 138): cursor_enable set to: 1
D/hwcomposer( 138): didim_enable set to: 1
D/hwcomposer( 138): didim_normal set to: 3
D/hwcomposer( 138): didim_video set to: 5
D/hwcomposer( 138): Null display size set to: 1920x1920
D/hwcomposer( 138): HDMI preferred resolution set to: Max_60Hz
D/hwcomposer( 138): Compositor set to: glcomposer
D/hwcomposer( 138): Composite policy set to: auto
D/hwcomposer( 138): composite_fallback set to: 1
D/hwcomposer( 138): Overriding minimum_fps, new value = 8
D/hwcomposer( 138): imp_enable set to: 1
E/hwcomposer( 138): failed to enumerate adf devices: Success
D/hwcomposer( 138): Using DC driver
D/hwcomposer( 138): Display 0: found 1 modes
D/hwcomposer( 138): display type 0: vblank period = 16671166 ns
D/hwcomposer( 138): void nvfb_event_process_pipe(void*): processing pipe fd
D/hwcomposer( 138): void nvfb_event_process_pipe(void*): processing pipe fd
D/hwcomposer( 138): virtual int dc_display::set_blank(int): display 0, [1 -> 1]
D/hwcomposer( 138): Display 1: found 18 modes
D/hwcomposer( 138): unmatched: 1920 x 1920 @ 59.96 Hz
D/hwcomposer( 138): unmatched: 1920 x 1920 @ 29.94 Hz
D/hwcomposer( 138): unmatched: 720 x 400 @ 70.05 Hz
D/hwcomposer( 138): matched: 640 x 480 @ 60.00 Hz
D/hwcomposer( 138): unmatched: 800 x 600 @ 60.32 Hz
D/hwcomposer( 138): unmatched: 1024 x 768 @ 60.01 Hz
D/hwcomposer( 138): unmatched: 1920 x 1200 @ 60.00 Hz
D/hwcomposer( 138): matched: 1920 x 1080 @ 60.00 Hz
D/hwcomposer( 138): unmatched: 1600 x 1200 @ 60.01 Hz
D/hwcomposer( 138): unmatched: 1600 x 900 @ 59.99 Hz
D/hwcomposer( 138): unmatched: 1280 x 1024 @ 60.02 Hz
D/hwcomposer( 138): unmatched: 1280 x 960 @ 60.00 Hz
D/hwcomposer( 138): matched: 1280 x 720 @ 59.67 Hz
D/hwcomposer( 138): unmatched: 2048 x 2048 @ 59.43 Hz
D/hwcomposer( 138): matched: 1920 x 1080 @ 60.00 Hz
D/hwcomposer( 138): matched: 1280 x 720 @ 60.00 Hz
D/hwcomposer( 138): matched: 720 x 480 @ 59.94 Hz
D/hwcomposer( 138): unmatched: 640 x 480 @ 61.05 Hz
D/hwcomposer( 138): display type 1: vblank period = 16666650 ns
E/hwcomposer( 138): HDCP: hdcp_open failed, error 1
D/hwcomposer( 138): Setting vblank display to Internal, new vblank period 16666650 ns
D/hwcomposer( 138): display type 2: vblank period = 0 ns
W/hwcomposer( 138): failed to load libnvcap_video.so: dlopen failed: library "libnvcap_video.so" not found
D/hwcomposer( 138): Display 0 layer size is 1920 x 1920
D/hwcomposer( 138): Display 0 device size is 1920 x 1080
D/hwcomposer( 138): Display 0 device clip is (420, 0, 1500, 1080)
D/hwcomposer( 138): config[0].x = 1920
D/hwcomposer( 138): config[0].y = 1080
D/hwcomposer( 138): int hwc_blank(hwc_composer_device_1*, int, int): display 0: unblank
D/hwcomposer( 138): void hwc_blank_display(nvhwc_context*, int, int): display 0: [1 -> 0]
D/hwcomposer( 138): Display 0 device size is 1920 x 1080
D/hwcomposer( 138): Display 0 device clip is (420, 0, 1500, 1080)
D/hwcomposer( 138): virtual int dc_display::set_blank(int): display 1, [1 -> 0]
The log of dumpsys SurfaceFlinger shows SurfaceFlinger render the 1920x1920 buffer:
h/w composer state:
h/w composer present and enabled
Hardware Composer state (version 01030000):
mDebugForceFakeVSync=0
Display[0] configurations (* current):
* 0: 1920x1920, xdpi=320.000000, ydpi=320.000000, refresh=16666650
numHwLayers=3, flags=00000000
type | handle | hint | flag | tr | blnd | format | source crop (l,t,r,b) | frame | name
-----------+----------+------+------+----+------+-------------+--------------------------------+------------------------+------
HWC | b6417b40 | 0000 | 0000 | 00 | 0100 | RGBA_8888 | 0.0, 0.0, 1920.0, 1920.0 | 0, 0, 1920, 1920 | com.android.systemui.ImageWallpaper
HWC | b6418040 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 1920.0 | 0, 0, 1920, 1920 | StatusBar
FB TARGET | b40f9e80 | 0000 | 0000 | 00 | 0105 | RGBA_8888 | 0.0, 0.0, 1920.0, 1920.0 | 0, 0, 1920, 1920 | HWC_FRAMEBUFFER_TARGET
Nvidia HWC:
Display 0 (PRIMARY):
Resolution: 1920 x 1080
Blank: false
Protected: false
Compositor: glcomposer
Composition: 2 layers in a scratch buffer
Window 0 (phys 2 caps 63): unused
Window 1 (phys 1 caps 63): unused
Window 2 (phys 0 caps 99 blend 0x105 xform 0x0): scratch containing 2 layers
src (0.0,0.0,1080.0,1080.0), dst (420.0,0.0,1500.0,1080.0)
Cursor (max 256): unused
Display 1 (EXTERNAL):
disabled
Composite policy: auto
Idle machine: detection enabled, composite enabled
Allocated buffers:
0xb35c4280: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00000b00
0xb40f9e80: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00001a00
0xb4dcf400: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00001a00
0xb6417b40: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00000b00
0xb6417dc0: 14040.00 KiB | 1920 (1920) x 1872 | 1 | 0x00000b00
0xb6417f00: 14040.00 KiB | 1920 (1920) x 1872 | 1 | 0x00000b00
0xb6418040: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00000b00
0xb662a3c0: 0.25 KiB | 1 ( 64) x 1 | 1 | 0x00000933
0xb662a500: 14400.00 KiB | 1920 (1920) x 1920 | 1 | 0x00000933
0xb662ab40: 14040.00 KiB | 1920 (1920) x 1872 | 1 | 0x00000b00
Total allocated (estimate): 128520.25 KB
Nvidia Gralloc
Compression: on
Decompression: lazy
GPU mapping cache: on
Continuous property scan: off
There still a problem is that hwcomposer still use 1920x1080 resolution output and the “unmatched” log still exist.
Does anyone know how to solve this problem ?
Is there have any system property I can set or any method I can try to adjust hwcomposer to output with right resolution ?