Hello,
I tried to scale my application (720x480) on a 720p screen - but get only distorted output.
I tried all the following:
- 720x480 -> 720x480 - shows right content, but no scaling
- 740x500 -> 740x500 - shows right content, but no scaling
- 720x480 -> 1280x720 - distorted (full screen)
- 720x480 -> 1278x718 - distorted (full screen - with 2px border)
- 720x480 -> 1080x720 - distorted (full screen - correct ratio)
- 720x480 -> 1008x672 - distorted (correct ratio with border)
The code looks like this:
int fd = open( "/dev/fb0", O_SYNC );
if (fd == -1) {
perror("failed to open display device\n");
return -1;
}
struct ti81xxfb_scparams scprms;
struct ti81xxfb_region_params regp;
scprms.inwidth = SCREEN_WIDTH; /* 720 */
scprms.inheight = SCREEN_HEIGHT; /* 480 */
scprms.outwidth = 1280 - 2;
scprms.outheight = 720 - 2;
scprms.coeff = NULL;
if (ioctl(fd, TIFB_SET_SCINFO, &scprms) < 0) {
perror("TIFB_SET_SCINFO.\n");
close(fd);
exit(1);
}
if (ioctl(fd, TIFB_GET_PARAMS, ®p) < 0) {
perror("TIFB_GET_PARAMS\n");
close(fd);
exit(1);
}
regp.scalaren = TI81XXFB_FEATURE_ENABLE;
if (ioctl(fd, TIFB_SET_PARAMS, ®p)< 0) {
perror("TIFB_SET_PARAMS\n");
close(fd);
exit(1);
}
close( fd );
Best regards,
Charly