Restrict kernel display driver or Android OS to use only a part of display pixels / resolution

cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict kernel display driver or Android OS to use only a part of display pixels / resolution

6,082 Views
DiegoFSL
Contributor III

Hello everybody.

I've got an i.MX6SL EVK with a "MXIMX28LCD Seiko 4.3" WVGA" display running Android 4.3 beta BSP (jb4.3_1.0.0-beta). The system is working fine at native 800x480 display resolution.

My target now is to use a resolution of 240x240 on that display (so using just a subarea), so that we can design properly applications for a 240x240 display we will be using in the future, but is not ready yet at the moment.

I've tried both the "display driver way" and the "Android OS drawing way", but I haven't reached my target yet.

DISPLAY DRIVER WAY

I've looked at the sources drivers/video/mxc/mxc_elcdif_fb.c and drivers/video/mxc/mxcfb_seiko_wvga.c in the kernel and I've found that the 800x480 is selected by the call:

fb_find_mode(&fbi->var, fbi, fb_mode, pdata->mode, pdata->num_modes, NULL, default_bpp);

at line 1438 of mxc_elcdif_fb.c:

linux-2.6-imx.git - Freescale i.MX Linux Tree

pdata->num_modes, NULL, default_bpp);

which I think is the one reported in:

/sys/devices/platform/mxc_elcdif_fb/graphics/fb0/modes

But I'm not sure what's the best way to modify the source to have 240x240. I've tried following https://community.freescale.com/thread/311900 but I don't know if I can apply it for using just 240x240 of a 800x480 display.

ANDROID OS DRAWING WAY

In this case I've tried modifying method mapFrameBufferWithFbid of hardware/imx/mx6/libgralloc_wrapper/framebuffer.cpp but I got only a full white display by forcing:

info.xres = 240;

info.yres = 240;

I'd really appreciate any help to achieve this hack.

Thanks,

Diego

Labels (5)
4 Replies

617 Views
nehaprabhakar
Contributor I

Hi Diego,

I am trying to the same for Nexus 4 device. Were you able to draw 240x240???

If yes then can you help me with the same.

Currently I have tried changing the panel info of xres and yres in kernel display driver file mipi_lgit_video_wxga_pt.c with 400x400. But only display is getting changed.

The touchscreen is still mapped to the initial resolution(768x1280).

Any help will be really appreciated.

0 Kudos

617 Views
DiegoFSL
Contributor III

Sorry for the late reply but no, I haven't spent additional time on that.

0 Kudos

618 Views
jamesbone
NXP TechSupport
NXP TechSupport

The best option, it is modifying the low level driver that handles the V4L2, just like the thread it is implemented by weidong.sunIMX6SLEVK: Custom display - 320x240@60Hz  and then change the bootargs to acknowledge the new resolution.

Saludos

618 Views
DiegoFSL
Contributor III

Thank you. I've been able to use the 320x240 in this way, but not yet 240x240, as it's not a standard resolution. Thank you however for your help.

0 Kudos