Couldn't decide if it would be worth starting an entirely separate thread, but I fixed the framebuffer so that it's oriented correctly. I thought about creating a merge request, but I was using NVIDIA's Tegra device tree, which is...really different.
In any case, here's my device tree. The bulk of the fix is in common/recovery/graphics.c, in the gr_flip() method. In the default graphics.c file, this method basically just does a memcpy() from memory to the framebuffer. The modified version is this:
Code:void gr_flip(void) { GGLContext *gl = gr_context; /* swap front and back buffers */ if (double_buffering) gr_active_fb = (gr_active_fb + 1) & 1; int buffer = 0; int fbsize = fi.line_length * vi.yres; // Copy the in-memory buffer into the buffer we're about to make // active, but reverse the order of the pixels. for (buffer = 0; buffer < fbsize; buffer += 4) { const char *src = (char *)gr_mem_surface.data; char *dst = (char *)gr_framebuffer[gr_active_fb].data; // Since we're reversing the buffer data, we need to flip the order // of the subpixel values, too. Otherwise they'll be backwards. dst[(fbsize-(buffer+4))] = src[buffer-PIXEL_OFFSET]; dst[(fbsize-(buffer+3))] = src[buffer+1-PIXEL_OFFSET]; dst[(fbsize-(buffer+2))] = src[buffer+2-PIXEL_OFFSET]; dst[(fbsize-(buffer+1))] = src[buffer+3-PIXEL_OFFSET]; } /* inform the display driver */ set_active_framebuffer(gr_active_fb); }
There are a few other smallish adjustments that I had to make in order to get everything lined up correctly. That offset is because without it I was getting some weird padding on the right side of the screen, for example. Anyway, I've got it running on my LTE Shield and haven't had any issues. Did a backup, performed a partial restore, flashed SuperSu, etc.
If anyone wants to try the recovery, I've attached a zipped copy of the image. This is NOT a zip that you can flash from your current recovery, I just zipped it because the raw image exceeds XDA's file upload limit apparently. Unzip the image, then flash it or boot it via fastboot or Flashify or whatnot, just like any other recovery image. MD5 for the image (not the zip) should be 7959f08d9266b60da46f44ab4333c92a. I make no promises, but as I said, it's working fine on my Shield.
Nice! I will implement this when nvidia finally releases the lollipop tree. They are taking an extended amount of time I may go ahead and just bring up the device without them.