[PATCH:xf86-video-siliconmotion 2/2] Support Gdium.

Connor Behan connor.behan at gmail.com
Wed Sep 16 18:54:24 PDT 2015


On 14/09/15 12:39 PM, Thomas Klausner wrote:
> From: Michael Lorenz <macallan at NetBSD.org>
>
> Comment out Int10 support since it's useless on Gdium/SM50x.
> ---
So there's a particular SMI chipset where attempting to access the VBIOS
causes problems even though the arch is x86? I would feel better using a
runtime check for this pciid instead of depriving other users of int10.

>  src/smi_driver.c     | 7 +++++--
>  src/smilynx_crtc.c   | 8 ++++----
>  src/smilynx_hw.c     | 5 ++++-
>  src/smilynx_output.c | 3 ++-
>  4 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/src/smi_driver.c b/src/smi_driver.c
> index 2568637..59e6d15 100644
> --- a/src/smi_driver.c
> +++ b/src/smi_driver.c
> @@ -1020,6 +1020,7 @@ SMI_DetectPanelSize(ScrnInfoPtr pScrn)
>  
>      if (pSmi->lcdWidth == 0 || pSmi->lcdHeight == 0) {
>  	/* panel size detection ... requires BIOS call on 730 hardware */
> +#ifdef USE_INT10
>  	if (pSmi->Chipset == SMI_COUGAR3DR) {
>  	    if (pSmi->pInt10 != NULL) {
>  		pSmi->pInt10->num = 0x10;
> @@ -1076,7 +1077,9 @@ SMI_DetectPanelSize(ScrnInfoPtr pScrn)
>  	    /* Set this to indicate that we've done the detection */
>  	    pSmi->lcd = 1;
>  	}
> -	else if (IS_MSOC(pSmi)) {
> +	else
> +#endif /* USE_INT10 */
> +	if (IS_MSOC(pSmi)) {
>  	    pSmi->lcdWidth  = (READ_SCR(pSmi, PANEL_WWIDTH)  >> 16) & 2047;
>  	    pSmi->lcdHeight = (READ_SCR(pSmi, PANEL_WHEIGHT) >> 16) & 2047;
>  	}
> @@ -1266,7 +1269,7 @@ SMI_MapMmio(ScrnInfoPtr pScrn)
>  					     result);
>  
>  	if (err)
> -	    return (FALSE);
> +	    pSmi->MapBase = NULL;
>      }
>  #endif
>  
> diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
> index fb7183c..937cf36 100644
> --- a/src/smilynx_crtc.c
> +++ b/src/smilynx_crtc.c
> @@ -565,7 +565,7 @@ SMILynx_CrtcModeSet_bios(xf86CrtcPtr crtc,
>      CARD8 tmp;
>  
>      ENTER();
> -
> +#ifdef USE_INT10
>      /* Find the INT 10 mode number */
>      {
>  	static struct {
> @@ -604,14 +604,14 @@ SMILynx_CrtcModeSet_bios(xf86CrtcPtr crtc,
>  	    }
>  	}
>      }
> -
> +#endif
>      if(!reg->mode){
>  	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "SMILynx_CrtcModeSet_bios: Not a known BIOS mode: "
>  		   "falling back to direct modesetting.\n");
>  	SMILynx_CrtcModeSet_vga(crtc,mode,adjusted_mode,x,y);
>  	LEAVE();
>      }
> -
> +#ifdef USE_INT10
>      pSmi->pInt10->num = 0x10;
>      pSmi->pInt10->ax = reg->mode | 0x80;
>      xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting mode 0x%02X\n",
> @@ -632,7 +632,7 @@ SMILynx_CrtcModeSet_bios(xf86CrtcPtr crtc,
>  
>      SMICRTC(crtc)->video_init(crtc);
>      SMILynx_CrtcAdjustFrame(crtc, x,y);
> -
> +#endif
>      LEAVE();
>  }
>  
> diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c
> index b2ee8a5..9ad6ebf 100644
> --- a/src/smilynx_hw.c
> +++ b/src/smilynx_hw.c
> @@ -297,6 +297,7 @@ SMILynx_Save(ScrnInfoPtr pScrn)
>  	pSmi->ModeStructInit = TRUE;
>      }
>  
> +#ifdef USE_INT10
>      if (pSmi->useBIOS && pSmi->pInt10 != NULL) {
>  	pSmi->pInt10->num = 0x10;
>  	pSmi->pInt10->ax = 0x0F00;
> @@ -305,7 +306,7 @@ SMILynx_Save(ScrnInfoPtr pScrn)
>  	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n",
>  		   save->mode);
>      }
> -
> +#endif
>      if (xf86GetVerbosity() > 1) {
>  	xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV,
>  		       "Saved current video mode.  Register dump:\n");
> @@ -358,6 +359,7 @@ SMILynx_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
>      VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0, restore->SRA0);
>  
>      if (pSmi->useBIOS && restore->mode != 0){
> +#ifdef USE_INT10
>  	pSmi->pInt10->num = 0x10;
>  	pSmi->pInt10->ax = restore->mode | 0x80;
>  	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting mode 0x%02X\n",
> @@ -372,6 +374,7 @@ SMILynx_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
>  	/* Enable DPR/VPR registers. */
>  	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
>  	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
> +#endif
>      } else {
>  	/* Restore the standard VGA registers */
>  	vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL);
> diff --git a/src/smilynx_output.c b/src/smilynx_output.c
> index 5ac0bbd..aa17a0c 100644
> --- a/src/smilynx_output.c
> +++ b/src/smilynx_output.c
> @@ -124,6 +124,7 @@ SMILynx_OutputDPMS_lcd(xf86OutputPtr output, int mode)
>  static void
>  SMILynx_OutputDPMS_bios(xf86OutputPtr output, int mode)
>  {
> +#ifdef USE_INT10
>      ScrnInfoPtr pScrn = output->scrn;
>      SMIPtr pSmi = SMIPTR(pScrn);
>  
> @@ -147,7 +148,7 @@ SMILynx_OutputDPMS_bios(xf86OutputPtr output, int mode)
>      pSmi->pInt10->cx = 0x0000;
>      pSmi->pInt10->num = 0x10;
>      xf86ExecX86int10(pSmi->pInt10);
> -
> +#endif
>      LEAVE();
>  }
>  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150916/5cd20f69/attachment.sig>


More information about the xorg-devel mailing list