alpine 3.6
obsolete weakness #96

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

xf86-video-i740/src/xf86-video-i740-1.3.6/src/i740_video.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

     CARD32 YRGBSCALE;
    CARD32 UVSCALE;
    CARD32 OV0CLRC0;
    CARD32 OV0CLRC1;
    CARD32 DCLRKV;
    CARD32 DCLRKM;
    CARD32 SCLRKVH;
    CARD32 SCLRKVL;
    CARD32 SCLRKM;
    CARD32 OV0CONF;
    CARD32 OV0CMD;
} I740OverlayRegRec, *I740OverlayRegPtr;

#define GET_PORT_PRIVATE(pScrn) \
   (I740PortPrivPtr)((I740PTR(pScrn))->adaptor->pPortPrivates[0].ptr)


/*-----------------------------------------------------------------------------------------*/
__inline__ static void i740fb_overlay_off(ScrnInfoPtr pScrn)
{
  I740Ptr pI740 = I740PTR(pScrn);

    /* 0x3C = COL_KEY_CNTL_1 */
  i740_wc(fb_p, MRX, 0x3C, (i740_rc(fb_p, MRX, 0x3C) |  0x02));
  usleep(50000);
  /*i740_wc(fb_p, XRX, 0xD0, (i740_rc(fb_p, XRX, 0xD0) & ~0x10));
  usleep(50000);*/
  i740_wc(fb_p, XRX, 0xD0, 0x2F);
}

__inline__ static void i740fb_overlay_set(ScrnInfoPtr pScrn, I740PortPrivPtr pPriv, unsigned long mem1,unsigned long mem2,
					  unsigned long isrc_w,unsigned long isrc_h, /* source      image size */
					  unsigned long idst_w,unsigned long idst_h, /* destination image size */
					  unsigned long ddst_x,unsigned long ddst_y, /* destination image pos to display */
					  unsigned long ddst_w,unsigned long ddst_h, /* destination image size to display allows trunc... */
					  unsigned long pitch,int flip,
					  unsigned char vd_mod)
{
  I740Ptr pI740 = I740PTR(pScrn);
  const int f_dbl=pScrn->currentMode->Flags & V_DBLSCAN;

  if(f_dbl) { idst_h*=2; ddst_y*=2; ddst_h*=2;  }

  ddst_x+=pI740->ov_offset_x;
  ddst_y+=pI740->ov_offset_y;

      /* Program the i740 overlay to use the new image dimensions. */

    i740_wc(fb_p, MRX, 0x24, mem1>>16);
    i740_wc(fb_p, MRX, 0x23, mem1>> 8); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.