In which part of Android ajust code to calibrate screen

269 views
Skip to first unread message

petr....@gmail.com

unread,
Feb 19, 2014, 3:49:54 PM2/19/14
to android...@googlegroups.com
Hi there,

I need to calibrate screen (move coordinates to right, basically add some
margin to left). Where is the best place to adjust the code? In kernel driver?
Or would it be possible and easier in user space libraries? Or is there a some 
boot parameter? (something like disp.screen0_output_mode from

I'm using Allwinner A31.

Thanks for any advice.

Regards,
Petr

Vishveshwar

unread,
Feb 20, 2014, 6:41:39 AM2/20/14
to android...@googlegroups.com

Refer to the AOSP documentation:
http://s.android.com/devices/tech/input/touch-devices.html#touch-device-driver-requirements

As per point 5, you need to supply the min and max values for the x and y axes corresponding to the edges of the actual display area. Android framework then takes care of calibration.

As an example, in the rowboat kernel for AM335x, the x-min, x-max, y-min, y-max corresponding to the display corners are set up as platform data to be supplied to the Touch driver, which in turn sends it to the Android framework using the input subsystem of the kernel.

https://gitorious.org/rowboat/kernel/source/03f2a1e9ea7f8b11ff6809f5a75b614011f8adb6:arch/arm/mach-omap2/board-am335xevm.c#L270

https://gitorious.org/rowboat/kernel/source/03f2a1e9ea7f8b11ff6809f5a75b614011f8adb6:drivers/input/touchscreen/ti_tsc.c#L392

To obtain the min/max values you can use the getevent utility in android
http://s.android.com/devices/tech/input/getevent.html

-Vishveshwar


Regards,
Petr

petr....@gmail.com

unread,
Feb 21, 2014, 7:37:40 PM2/21/14
to android...@googlegroups.com
Hi Vishveshwar,

thank you for nice examples. I'm using two probably proprietary drivers (one connected to LCD other connected with MIPI) which both uses drv_display.h header on a31, kernel 3.3. This header seems to be also any min_x & min_y in used structures :-(. Does it mean that it's not possible to use this approach?

I'm thinking about using fbset.

Thanks for any info.

Best regards,
Petr

Vishveshwar

unread,
Feb 24, 2014, 1:34:43 AM2/24/14
to android...@googlegroups.com
On Saturday, February 22, 2014 6:07:40 AM UTC+5:30, petr....@gmail.com wrote:
Hi Vishveshwar,

thank you for nice examples. I'm using two probably proprietary drivers (one connected to LCD other connected with MIPI) which both uses drv_display.h header on a31, kernel 3.3. This header seems to be also any min_x & min_y in used structures :-(. Does it mean that it's not possible to use this approach?

I'm thinking about using fbset.

It seems you wish to adjust the LCD display itself and not the touch. Sorry about the misunderstanding.

If I understood you correctly, the Android display itself is shifted to an offset from the LCD display boundary. Not the touchscreen response to a tap, swipe etc.
My initial reply applies only for the touchscreen calibration.

I am not very familiar with the display stuff. I am guessing the LCD parameters in your driver need some tuning or something like that.

You could also try the android-kernel mailing list for help, since this seems more like a kernel issue.

-Vishveshwar

petr....@gmail.com

unread,
Feb 25, 2014, 2:39:31 AM2/25/14
to android...@googlegroups.com
Hi Vishveshwar.

It seems you wish to adjust the LCD display itself and not the touch. Sorry about the misunderstanding.
You're right. Thanks a lot for info anyway. Ok, I'l try ask on android kernel.

Best regards,
Petr

Alvin Wong

unread,
Feb 25, 2014, 9:35:11 AM2/25/14
to android...@googlegroups.com
Haven't checked the info of your device, but here're my two cents:

If it's the image on the LCD panel shifted from where it's supposed to be (i.e. a part of screen isn't on the panel at all), it could be due to overscan, vsync (is it?), etc, and you'll need to correct the corresponding framebuffer settings in the kernel.

If it's the LCD panel itself misplaced (i.e. the image is on the panel but hidden by the frame), then I've no idea where you can change the behaviour in software.

Normally, if it is case 1, you may see a black region on the opposite side of the invisible part, and their sizes should match.

Not sure if this helps.

petr....@gmail.com

unread,
Feb 25, 2014, 10:05:10 AM2/25/14
to android...@googlegroups.com
Hi there, 

If it's the LCD panel itself misplaced (i.e. the image is on the panel but hidden by the frame), then I've no idea where you can change the behaviour in software.

Yes, that's the reason (part of the LCD panel is hidden by frame), that's why I want to set offset.


Regards,
Petr
Reply all
Reply to author
Forward
0 new messages