Enable 4k-UHD in Android 9 (AOSP)

Hi, I’m running Android 9 on the Rock960 board.

Does anybody know how I can enable the board to drive a UHD video in the Android 9? I have a UHD monitor (3840x2160) and when I plug the HDMI cable to the monitor, the video shows up fine, however, when I run

adb shell dumpsys display

it shows up that the built-in screen is 1920x1080 (FullHD).

I would like to enable the android to drive a uhd video to the monitor.


The maximum resolutions currently supported are 1920x1080p or 1920x1200p.

You sure about that?
AFAICT, it supports up to 4096x2160@60.
Modes are available on a whitelist basis, defined here;

@gsousa : my first guess is that EITHER it is defaulting to a different mode than your display’s maximum, or your display doesn’t present a mode in its EDID that precisely matches one of the high resolutions in the whitelist.

I think that they may also have done come monkeying around with the UI resolution vs the playback resolution. I think I remember reading somewhere that they have it set up to use a lower resolution for UI rendering than video playback, and that they did this for performance reasons. I could be imagining it though. There is definitely, however, a steaming heap of horribleness in their source tree, which we should be able to eliminate once the RKVDEC/VPU support for HEVC reaches upstream linux.

You’re correct, I’ve overlooked the board (I mixed up with hikey960).
@gsousa, could you please add the rock960 tag.

Hi, thanks for helping.

I think somewhere in the driver or hwcomposer it filters out the uhd for some reason. My monitor’s edid has the 3840x2160p resolution standard timings. It works fine with other development boards and also the desktop. Here’s a shot of the xrandr:

done, thanks for the heads up

How about using copy/paste into a code block instead of a picture? Your picture makes it impossible to look at.

The idea was to test the performance in a 3840x2160 resolution, it may get very slow, but I wanted to know how slow. So I wanted to find where is the set up to use a lower resolution and just let it use the preferred resolution of my monitor regardless

I just copied the output the of xrandr command to prove that my monitor’s EDID contains the resolution 3840x2160p.

gsousa@linux01:~$ xrandr
Screen 0: minimum 8 x 8, current 7680 x 2160, maximum 32767 x 32767
DP-4 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 597mm x 336mm
3840x2160     60.00*+  29.98  
2560x1440     59.95  
1920x2160     59.99  
1920x1080     60.00    59.94    50.00  
1680x1050     59.95  
1440x900      59.89  
1280x1024     75.02    60.02  
1280x960      60.00  
1280x720      60.00    59.94    50.00  
1024x768      75.03    70.07    60.00  
800x600       75.00    72.19    60.32    56.25  
720x576       50.00  
720x480       59.94  
640x480       75.00    72.81    59.94    59.93  
 DP-5 disconnected (normal left inverted right x axis y axis)
 DP-6 disconnected (normal left inverted right x axis y axis)
 DP-7 disconnected (normal left inverted right x axis y axis)

The modes aren’t shown in there. Use “xrandr --verbose”.

Example mode from xrandr --verbose:

  1920x1080 (0x24) 173.000MHz -HSync +VSync *current +preferred
        h: width  1920 start 2048 end 2248 total 2576 skew    0 clock  67.16KHz
        v: height 1080 start 1083 end 1088 total 1120           clock  59.96Hz

Now you have to look at the resolution whitelist, example entry;

	<resolution> <!-- 3840x2160P24 -->

To map the xrandr mode to the entry look at it like this;

  1920x1080 (0x24) <clock> <flags>
        h: width  <hdisplay> start <hsync_start> end <hsync_end> total <htotal> skew <hskew> clock  67.16KHz
        v: height <vdisplay> start <vsync_start> end <vsync_end> total <vtotal> clock  59.96Hz

Do you have any modes that ACTUALLY MATCH? You can’t just have SOME fields that match – they ALL have to match.

If there is no matching mode in the whitelist, then you need to add your mode to the whitelist and cross your fingers that it works because there is NO GUARANTEE.

You should be able to edit/replace the whitelist on device (i.e., without rebuilding Android). The file is copied to /system/usr/share/resolution_white.xml


The rockchip “render the UI at max 1080 lines” hack;

So obviously I didn’t imagine that.