From: "Wu, Tong1" <tong1.wu-at-intel.com@ffmpeg.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH v7 1/9] libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 Date: Wed, 30 Aug 2023 02:27:02 +0000 Message-ID: <SN6PR11MB29907FE97F0528B8394FEA6EC0E6A@SN6PR11MB2990.namprd11.prod.outlook.com> (raw) In-Reply-To: <Nd27DVv--3-9@lynne.ee> >Aug 29, 2023, 06:15 by tong1.wu-at-intel.com@ffmpeg.org: > >> + >> + /** >> + * Specifed by sync=1 when init d3d12va >> + * >> + * Execute commands as sync mode >> + */ >> + int sync; >> > >This is not needed, particularly in the public API. > >> + if (download) { >> + ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, >&barrier); >> + >> + ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, >> + &staging_y_location, 0, 0, 0, &texture_y_location, NULL); >> + >> + ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list, >> + &staging_uv_location, 0, 0, 0, &texture_uv_location, NULL); >> + >> + barrier.Transition.StateBefore = barrier.Transition.StateAfter; >> + barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON; >> + ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, >&barrier); >> + >> + DX_CHECK(ID3D12GraphicsCommandList_Close(s->command_list)); >> + >> + if (!hwctx->sync) >> + DX_CHECK(ID3D12CommandQueue_Wait(s->command_queue, >sync_ctx->fence, sync_ctx->fence_value)); > >This is wrong. When downloading to RAM, the frames must >always be available and fully downloaded by the time the function >returns. Therefore, a wait must always occur. >Since this is the only place where sync is used, better remove the >option altogether. There's another place where it's used. It's designed for API users to blocking wait every decoded frame. In end_frame() call in d3d12va_decode.c. if (ctx->device_ctx->sync) { ret = d3d12va_wait_idle(ctx->sync_ctx); if (ret < 0) return ret; } That's why when downloading, you don't have to wait again if hwctx->sync is specified. The frame has already been blocking synced in decoding process. But yes I agree it's not that needed. I'll remove the whole design in next version. Thanks, Tong >_______________________________________________ >ffmpeg-devel mailing list >ffmpeg-devel@ffmpeg.org >https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > >To unsubscribe, visit link above, or email >ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-08-30 2:27 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-29 4:10 Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 2/9] avcodec: add D3D12VA hardware accelerated H264 decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 3/9] avcodec: add D3D12VA hardware accelerated HEVC decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 4/9] avcodec: add D3D12VA hardware accelerated VP9 decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 5/9] avcodec: add D3D12VA hardware accelerated AV1 decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 6/9] avcodec: add D3D12VA hardware accelerated MPEG-2 decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 7/9] avcodec: add D3D12VA hardware accelerated VC1 decoding Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 8/9] Changelog: D3D12VA hardware accelerated H264, HEVC, VP9, AV1, MPEG-2 and " Tong Wu 2023-08-29 4:10 ` [FFmpeg-devel] [PATCH v7 9/9] avcodec/d3d12va_hevc: enable allow_profile_mismatch flag for d3d12va msp profile Tong Wu 2023-08-29 4:20 ` [FFmpeg-devel] [PATCH v7 1/9] libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 Wu, Tong1 2023-08-29 21:09 ` Lynne 2023-08-30 2:27 ` Wu, Tong1 [this message] 2023-08-30 8:38 ` Lynne 2023-08-30 9:05 ` Wu, Tong1 2023-08-30 14:25 ` Lynne 2023-08-31 6:36 ` Wu, Tong1
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=SN6PR11MB29907FE97F0528B8394FEA6EC0E6A@SN6PR11MB2990.namprd11.prod.outlook.com \ --to=tong1.wu-at-intel.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git