This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TIFB_SET_SCINFO / Screen Transformation: Scaling

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, &regp) < 0) {
        perror("TIFB_GET_PARAMS\n");
        close(fd);
        exit(1);
    }

    regp.scalaren = TI81XXFB_FEATURE_ENABLE;
   
    if (ioctl(fd, TIFB_SET_PARAMS, &regp)< 0) {
        perror("TIFB_SET_PARAMS\n");
        close(fd);
        exit(1);
    }

    close( fd );

 

Best regards,

Charly

  • The attached is the FBDev Scaling example. It should be part of PSP release package. but I attached here in the case you do not have it.

    Regards,

    yihe

  • Yihe,

    thanks a lot. I did not set the resolution in VSCREENINFO...

        struct fb_var_screeninfo varinfo;

        if( ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) < 0 )
            perror( "FBIOGET_VSCREENINFO" );

        varinfo.xres = PTSCREEN_WIDTH + 20;
        varinfo.yres = PTSCREEN_HEIGHT + 20;

        varinfo.xres_virtual = varinfo.xres;
        varinfo.yres_virtual = varinfo.yres;

        if( ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0 )
            perror( "FBIOPUT_VSCREENINFO" );

        if( ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) < 0 )
            perror( "FBIOGET_VSCREENINFO" );


        scprms.inwidth   = varinfo.xres;       /* 720 */
        scprms.inheight  = varinfo.yres;       /* 480 */
        scprms.outwidth  = 1280 - 2;
        scprms.outheight =  720 - 2;
        scprms.coeff     = NULL;

    Regards,

    Charly