From patchwork Wed Jan 2 08:30:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas schorpp X-Patchwork-Id: 16057 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TqJiM-0003L1-AK; Wed, 02 Jan 2013 09:30:18 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1TqJiK-0002XI-AY; Wed, 02 Jan 2013 09:30:17 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752546Ab3ABIaN (ORCPT + 1 other); Wed, 2 Jan 2013 03:30:13 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:35539 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540Ab3ABIaM (ORCPT ); Wed, 2 Jan 2013 03:30:12 -0500 Received: by mail-ee0-f46.google.com with SMTP id e53so6651423eek.19 for ; Wed, 02 Jan 2013 00:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :cc:subject:content-type; bh=zKL/XQnlzpI3lIOBuLRbXNO6J9sQL4x9JulV+glzsRU=; b=c0apnQ2Oj0kXDxlG14pTKkpuYjX9qSAKh+oDB6ZNgyatF2270IF7yrWSzQjRAQgh0o JcxpC+2HBCxqx849LRgHYJuyoApuAAR2GJEkXNBEeKmhHab9P4iaiZ4q4sETwtBTgQk8 stnrJWN709qHm1ddbsCC3BYxm6iP8YwmpXioBdz+oHQ0yLOiPuvbxHdninsROkOnG7DU m1rugSsEfmUbdD5SWD1EAna71KryeQxxzId98hqat01Jo/3W4BuviTBeUnadGd8v1OK2 /xSxQJpwiay3+pczVqnIFTma5FpMuQkR/TDoq0ncg5Hj0DY7z9AlfzyJVNmlTRRrg+F7 uBXg== X-Received: by 10.14.223.135 with SMTP id v7mr123654692eep.41.1357115410740; Wed, 02 Jan 2013 00:30:10 -0800 (PST) Received: from [192.168.0.105] (HSI-KBW-109-192-058-124.hsi6.kabel-badenwuerttemberg.de. [109.192.58.124]) by mx.google.com with ESMTPS id w3sm96232808eel.17.2013.01.02.00.30.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 00:30:09 -0800 (PST) Message-ID: <50E3F00F.6040903@gmail.com> Date: Wed, 02 Jan 2013 09:30:07 +0100 From: thomas schorpp Reply-To: thomas.schorpp@gmail.com User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: linux-media@vger.kernel.org CC: palatis@gmail.com Subject: [PATCH/RFC] crystalhd-video (vaapi-backend): struct VADriverVTable *vtable; is heap, updated to API 0.32, configure GLX support misdetection Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.2.82115 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, SUPERLONG_LINE 0.05, BODY_SIZE_10000_PLUS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BAT_BOUNDARY 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FRAUD_WEBMAIL_REPLYTO 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_REPLYTO 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __PHISH_SPEAR_STRUCTURE_1 0, __REPLYTO_SAMEAS_FROM_ACC 0, __REPLYTO_SAMEAS_FROM_ADDY 0, __REPLYTO_SAMEAS_FROM_DOMAIN 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0, __YOUTUBE_RCVD 0' Hi, I've found at http://gitorious.org/crystalhd-video "palatis" has started an vaapi backend for crystalhd and updated it to API rev. 0.32 but RFC #1, Applicable Linux Media API for Broadcom Crystal HD decoders: I don't know yet if vaapi or vdpau is the right approach for a acceptable API for Broadcom crystal hd decoders, since it's a decoder (codec) not just an accelerator on such GPUs and as I understand the little documentation so far, both APIs are X-Server rendering dependant but we've got many decoding only and framebuffer, transcoding and embedded systems use cases around to which neither the vdpau nor the vaapi concepts would apply then and both API were useless for transcoders then? Altough I don't know either yet if the Broadcom firmwares do allow faster than realtime movie framerate at all what transcoders usually need? According to the ISO-OSI model, I would not mix or force decoding and/to X- Output in one API model and leave such (hw-) codecs in ffmpeg etc. Fixes: 1. glx ext not detected by configure crystalhd-video configuration summary: VA-API version ................... : 0.32.0 VA-API drivers path .............. : /usr/lib/i386-linux-gnu/dri CRYSTALHD version ................ : "3" GLX support ...................... : no <------- ? # dpkg -L libva-dev |grep -i glx /usr/lib/i386-linux-gnu/pkgconfig/libva-glx.pc /usr/include/va/va_glx.h /usr/include/va/va_backend_glx.h /usr/lib/i386-linux-gnu/libva-glx.so Debug? ........................... : yes Tracer? .......................... : yes 2. struct VADriverVTable *vtable; is heap, not stack allocateable in API 0.32, patch attached. libtool: compile: gcc -DHAVE_CONFIG_H -I. -std=c99 -g -O2 -D__LINUX_USER__ -MT crystalhd_drv_video.lo -MD -MP -MF .deps/crystalhd_drv_video.Tpo -c crystalhd_drv_video.c -fPIC -DPIC -o .libs/crystalhd_drv_video.o crystalhd_drv_video.c: In function '__vaDriverInit_0_31': crystalhd_drv_video.c:1851:13: error: request for member 'vaTerminate' in something not a structure or union ... crystalhd_drv_video.c:1894:13: error: request for member 'vaBufferInfo' in something not a structure or union make[2]: *** [crystalhd_drv_video.lo] Fehler 1 3. test results: init: vainfo: Running DIL (3.22.0) Version DtsDeviceOpen: Opening HW in mode 0 Clock set to 180 vainfo: VA-API version: 0.32 (libva 1.0.15) vainfo: Driver version: Broadcom Crystal HD Video Decoder 3.10.0.0 vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Simple : VAEntrypointMoComp VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointMoComp VAProfileH264Baseline : VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD DtsAllocIoctlData Error Manually linked to my GPU chipset name ln -s /usr/lib/i386-linux-gnu/dri/crystalhd_drv_video.so /usr/lib/i386-linux-gnu/dri/i915_drv_video.so but nothing is accessing it it seems. y tom -Att: patch against http://gitorious.org/crystalhd-video git master,HEAD at the timestamp of file. diff --git a/extra/crystalhd_wrapper/crystalhd_common.c b/extra/crystalhd_wrapper/crystalhd_common.c index c26d5a5..e0c7eb0 100644 --- a/extra/crystalhd_wrapper/crystalhd_common.c +++ b/extra/crystalhd_wrapper/crystalhd_common.c @@ -48,7 +48,7 @@ const char *string_of_BC_STATUS(BC_STATUS status) STATUS(CERT_VERIFY_ERROR); STATUS(DEC_EXIST_OPEN); STATUS(PENDING); - STATUS(CLK_NOCHG); +// STATUS(CLK_NOCHG); STATUS(ERROR); #undef STATUS } diff --git a/src/crystalhd_drv_video.c b/src/crystalhd_drv_video.c index 5fbae33..8f99f6a 100644 --- a/src/crystalhd_drv_video.c +++ b/src/crystalhd_drv_video.c @@ -1828,7 +1828,7 @@ crystalhd_Terminate( } VAStatus -__vaDriverInit_0_31( +__vaDriverInit_0_32( VADriverContextP ctx ) { @@ -1848,50 +1848,50 @@ __vaDriverInit_0_31( ctx->max_display_attributes = CRYSTALHD_MAX_DISPLAY_ATTRIBUTES; ctx->str_vendor = CRYSTALHD_STR_VENDOR; - ctx->vtable.vaTerminate = crystalhd_Terminate; - ctx->vtable.vaQueryConfigEntrypoints = crystalhd_QueryConfigEntrypoints; - ctx->vtable.vaQueryConfigProfiles = crystalhd_QueryConfigProfiles; - ctx->vtable.vaQueryConfigEntrypoints = crystalhd_QueryConfigEntrypoints; - ctx->vtable.vaQueryConfigAttributes = crystalhd_QueryConfigAttributes; - ctx->vtable.vaCreateConfig = crystalhd_CreateConfig; - ctx->vtable.vaDestroyConfig = crystalhd_DestroyConfig; - ctx->vtable.vaGetConfigAttributes = crystalhd_GetConfigAttributes; - ctx->vtable.vaCreateSurfaces = crystalhd_CreateSurfaces; - ctx->vtable.vaDestroySurfaces = crystalhd_DestroySurfaces; - ctx->vtable.vaCreateContext = crystalhd_CreateContext; - ctx->vtable.vaDestroyContext = crystalhd_DestroyContext; - ctx->vtable.vaCreateBuffer = crystalhd_CreateBuffer; - ctx->vtable.vaBufferSetNumElements = crystalhd_BufferSetNumElements; - ctx->vtable.vaMapBuffer = crystalhd_MapBuffer; - ctx->vtable.vaUnmapBuffer = crystalhd_UnmapBuffer; - ctx->vtable.vaDestroyBuffer = crystalhd_DestroyBuffer; - ctx->vtable.vaBeginPicture = crystalhd_BeginPicture; - ctx->vtable.vaRenderPicture = crystalhd_RenderPicture; - ctx->vtable.vaEndPicture = crystalhd_EndPicture; - ctx->vtable.vaSyncSurface = crystalhd_SyncSurface; - ctx->vtable.vaQuerySurfaceStatus = crystalhd_QuerySurfaceStatus; - ctx->vtable.vaPutSurface = crystalhd_PutSurface; - ctx->vtable.vaQueryImageFormats = crystalhd_QueryImageFormats; - ctx->vtable.vaCreateImage = crystalhd_CreateImage; - ctx->vtable.vaDeriveImage = crystalhd_DeriveImage; - ctx->vtable.vaDestroyImage = crystalhd_DestroyImage; - ctx->vtable.vaSetImagePalette = crystalhd_SetImagePalette; - ctx->vtable.vaGetImage = crystalhd_GetImage; - ctx->vtable.vaPutImage = crystalhd_PutImage; - ctx->vtable.vaQuerySubpictureFormats = crystalhd_QuerySubpictureFormats; - ctx->vtable.vaCreateSubpicture = crystalhd_CreateSubpicture; - ctx->vtable.vaDestroySubpicture = crystalhd_DestroySubpicture; - ctx->vtable.vaSetSubpictureImage = crystalhd_SetSubpictureImage; - ctx->vtable.vaSetSubpictureChromakey = crystalhd_SetSubpictureChromakey; - ctx->vtable.vaSetSubpictureGlobalAlpha = crystalhd_SetSubpictureGlobalAlpha; - ctx->vtable.vaAssociateSubpicture = crystalhd_AssociateSubpicture; - ctx->vtable.vaDeassociateSubpicture = crystalhd_DeassociateSubpicture; - ctx->vtable.vaQueryDisplayAttributes = crystalhd_QueryDisplayAttributes; - ctx->vtable.vaGetDisplayAttributes = crystalhd_GetDisplayAttributes; - ctx->vtable.vaSetDisplayAttributes = crystalhd_SetDisplayAttributes; - ctx->vtable.vaLockSurface = crystalhd_LockSurface; - ctx->vtable.vaUnlockSurface = crystalhd_UnlockSurface; - ctx->vtable.vaBufferInfo = crystalhd_BufferInfo; + ctx->vtable->vaTerminate = crystalhd_Terminate; + ctx->vtable->vaQueryConfigEntrypoints = crystalhd_QueryConfigEntrypoints; + ctx->vtable->vaQueryConfigProfiles = crystalhd_QueryConfigProfiles; + ctx->vtable->vaQueryConfigEntrypoints = crystalhd_QueryConfigEntrypoints; + ctx->vtable->vaQueryConfigAttributes = crystalhd_QueryConfigAttributes; + ctx->vtable->vaCreateConfig = crystalhd_CreateConfig; + ctx->vtable->vaDestroyConfig = crystalhd_DestroyConfig; + ctx->vtable->vaGetConfigAttributes = crystalhd_GetConfigAttributes; + ctx->vtable->vaCreateSurfaces = crystalhd_CreateSurfaces; + ctx->vtable->vaDestroySurfaces = crystalhd_DestroySurfaces; + ctx->vtable->vaCreateContext = crystalhd_CreateContext; + ctx->vtable->vaDestroyContext = crystalhd_DestroyContext; + ctx->vtable->vaCreateBuffer = crystalhd_CreateBuffer; + ctx->vtable->vaBufferSetNumElements = crystalhd_BufferSetNumElements; + ctx->vtable->vaMapBuffer = crystalhd_MapBuffer; + ctx->vtable->vaUnmapBuffer = crystalhd_UnmapBuffer; + ctx->vtable->vaDestroyBuffer = crystalhd_DestroyBuffer; + ctx->vtable->vaBeginPicture = crystalhd_BeginPicture; + ctx->vtable->vaRenderPicture = crystalhd_RenderPicture; + ctx->vtable->vaEndPicture = crystalhd_EndPicture; + ctx->vtable->vaSyncSurface = crystalhd_SyncSurface; + ctx->vtable->vaQuerySurfaceStatus = crystalhd_QuerySurfaceStatus; + ctx->vtable->vaPutSurface = crystalhd_PutSurface; + ctx->vtable->vaQueryImageFormats = crystalhd_QueryImageFormats; + ctx->vtable->vaCreateImage = crystalhd_CreateImage; + ctx->vtable->vaDeriveImage = crystalhd_DeriveImage; + ctx->vtable->vaDestroyImage = crystalhd_DestroyImage; + ctx->vtable->vaSetImagePalette = crystalhd_SetImagePalette; + ctx->vtable->vaGetImage = crystalhd_GetImage; + ctx->vtable->vaPutImage = crystalhd_PutImage; + ctx->vtable->vaQuerySubpictureFormats = crystalhd_QuerySubpictureFormats; + ctx->vtable->vaCreateSubpicture = crystalhd_CreateSubpicture; + ctx->vtable->vaDestroySubpicture = crystalhd_DestroySubpicture; + ctx->vtable->vaSetSubpictureImage = crystalhd_SetSubpictureImage; + ctx->vtable->vaSetSubpictureChromakey = crystalhd_SetSubpictureChromakey; + ctx->vtable->vaSetSubpictureGlobalAlpha = crystalhd_SetSubpictureGlobalAlpha; + ctx->vtable->vaAssociateSubpicture = crystalhd_AssociateSubpicture; + ctx->vtable->vaDeassociateSubpicture = crystalhd_DeassociateSubpicture; + ctx->vtable->vaQueryDisplayAttributes = crystalhd_QueryDisplayAttributes; + ctx->vtable->vaGetDisplayAttributes = crystalhd_GetDisplayAttributes; + ctx->vtable->vaSetDisplayAttributes = crystalhd_SetDisplayAttributes; + ctx->vtable->vaLockSurface = crystalhd_LockSurface; + ctx->vtable->vaUnlockSurface = crystalhd_UnlockSurface; + ctx->vtable->vaBufferInfo = crystalhd_BufferInfo; struct crystalhd_driver_data *driver_data = (struct crystalhd_driver_data *) malloc( sizeof(*driver_data) ); if ( NULL == driver_data )