[Intel-gfx] [PATCH 7/7] Xv: don't enable XVMC port on unsupported configs

Shuang He shuang.he at intel.com
Wed Dec 2 03:07:38 CET 2009


Daniel Vetter wrote:
> This just makes it _really_ clear, what's support. No other changes.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  src/i830_video.c |   17 +++++++++++++++--
>  1 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/src/i830_video.c b/src/i830_video.c
> index ef3aae3..7b32214 100644
> --- a/src/i830_video.c
> +++ b/src/i830_video.c
> @@ -169,7 +169,13 @@ static XF86AttributeRec GammaAttributes[GAMMA_ATTRIBUTES] = {
>  	{XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA5"}
>  };
>  
> +#ifdef INTEL_XVMC
>  #define NUM_IMAGES 5
> +#define XVMC_IMAGE 1
> +#else
> +#define NUM_IMAGES 4
> +#define XVMC_IMAGE 0
> +#endif
>  
>  static XF86ImageRec Images[NUM_IMAGES] = {
>  	XVIMAGE_YUY2,
> @@ -481,7 +487,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
>  		       sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
>  		att += GAMMA_ATTRIBUTES;
>  	}
> -	adapt->nImages = NUM_IMAGES;
> +	adapt->nImages = NUM_IMAGES - XVMC_IMAGE;
> +
>  	adapt->pImages = Images;
>  	adapt->PutVideo = NULL;
>  	adapt->PutStill = NULL;
> @@ -540,6 +547,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
>  
>  static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
>  {
> +	ScrnInfoPtr scrn = xf86Screens[screen->myNum];
> +	intel_screen_private *intel = intel_get_screen_private(scrn);
>  	XF86VideoAdaptorPtr adapt;
>  	XF86AttributePtr attrs;
>  	intel_adaptor_private *adaptor_privs;
> @@ -577,7 +586,11 @@ static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
>  	adapt->pAttributes = attrs;
>  	memcpy(attrs, TexturedAttributes,
>  	       nAttributes * sizeof(XF86AttributeRec));
> -	adapt->nImages = NUM_IMAGES;
> +	if (IS_I915(intel))
> +		adapt->nImages = NUM_IMAGES - XVMC_IMAGE;
>   

THe same issue that XvMC is supported on 945GM for KMS.

In i915_hwmc.c it means only 915G and 915GM, not all i915 (915G/GM, 
945G/GM, G33, ...) platforms.

Thanks
--Shuang


> +	else
> +		adapt->nImages = NUM_IMAGES;
> +
>  	adapt->pImages = Images;
>  	adapt->PutVideo = NULL;
>  	adapt->PutStill = NULL;
>   




More information about the Intel-gfx mailing list