K20/MI9T Pro DTBO Display OC Patching Tool (Patreon)
Downloads
Content
EDIT (14th October 2019): The tool & source-code were updated to allow the creation of relative-baseline dtbo images.
This basically allows you to go the other route, creating 60Hz (stock) dtbo images from already patched images.
Up until now it was necessary to rely on pre-patched dtbo.img files to overclock the K20/MI9T Pro's display refresh rate.
While this was a great feat by @realheart & @atomsand, it posed a multitude of problems.
- Providing pre-patched dtbo.img files requires constant manual updates on the developer's behalf
- The many regional variants of these devices all require a different dtbo.img for each and every region these devices are being sold in
- Flashing the wrong dtbo.img file on your device can leave it in a semi-bricked state where both TWRP & the main operating system are unbootable
To rectify this, I've decided to take a closer look at what these two chinese developers did in their dtbo.img files to achieve this.
As it turns out it's fairly simply. There's two properties that control the refresh rate of the screen, the framerate and the clockrate, the latter gets calculated from a baseline value and the framerate.
As it turns out their patch needed a little bit of extending to work on the global variants of this phone as well, given the fact that Xiaomi decided to add a new device-tree tag for the same exact screen. (Don't ask me why they did that...)
To make sure this patch won't get lost in time, forever undocumented, I've decided to create a simple .NET command line tool that will patch any K20/MI9T Pro dtbo.img you throw at it, essentially overclocking your screen anywhere from 63 to 90Hz, should you decide to flash the resulting output file that is...
To add a little cherry on top, I've also decided to publish the source code of the tool for those that want to take a closer look at the inner workings of this patch.
To use this tool, just drag the dtbo.img file you dumped into the .exe file, type the framerate you wish to use (60, 63, 66, 69, 72, 75, ..., 81, etc) and press enter, then wait for a minute or so until the window closes.
You will be presented with a new file named the same way as the file you dragged in, but with a ".out" at the end. This is the file you need to flash to get your screen overclocked.
For those that use TWRP to backup their dtbo.img: TWRP names the file dtbo.emmc.win.