Skip to content

[Decode] Reenable VC1 decode for DG2#1846

Open
nyanmisaka wants to merge 1 commit into
intel:masterfrom
nyanmisaka:enable-vc1dec-dg2
Open

[Decode] Reenable VC1 decode for DG2#1846
nyanmisaka wants to merge 1 commit into
intel:masterfrom
nyanmisaka:enable-vc1dec-dg2

Conversation

@nyanmisaka

Copy link
Copy Markdown
Contributor

The VC1 OLP kernel used by DG2 can share the same legacy CM interface with Gen12/TGLLP.
(BTW the existing kernel seems to target GENX_TGLLP instead of GENX_DG2)

Tested on Arc A380 with a few VC1 video samples.

Fixes: #1658

Signed-off-by: nyanmisaka nst799610810@gmail.com

@nyanmisaka

Copy link
Copy Markdown
Contributor Author

cc @Jexu

@Jexu Jexu self-requested a review August 26, 2024 03:38
@Jexu Jexu added the Decode video decode related label Aug 26, 2024
@Jexu Jexu requested a review from XinfengZhang August 26, 2024 03:41
mitzsch added a commit to mitzsch/media-driver that referenced this pull request Jan 24, 2026
mitzsch added a commit to mitzsch/media-driver that referenced this pull request Jan 24, 2026
@mitzsch

mitzsch commented Jan 25, 2026

Copy link
Copy Markdown

@Jexu Can this be merged?

It "still" works with the current upstream codebase...

@XinfengZhang

Copy link
Copy Markdown
Contributor

I see, it works, but could you share something about the usage , background? I want understand the motivation. we actually plan to deprecate VC1 decoding ...

@nyanmisaka

Copy link
Copy Markdown
Contributor Author
image

This has been brought up again recently because of an issue on Reddit r/IntelArc. I believe some Blu-ray enthusiasts want to rip discs from VC-1 to more efficient encoding formats like HEVC/AV1 to save hard drive space.

The VC-1 software decoder in ffmpeg only supports single-threading, so no matter how advanced your processor is, it cannot utilize multi-threading. Therefore, transcoding is always slow, even if you use a hardware encoder, especially for Blu-ray movies that are several hours long.

Personally, I don't expect Intel to bring it back on future Xe platforms, but since the VC-1 HAL on DG2 is already open source, it only requires a small patch to make it work by reusing the legacy CM interface from TGL, just as it already works on Windows. Although Intel probably won't want to spend the time validating it.

@mitzsch

mitzsch commented Jan 26, 2026

Copy link
Copy Markdown

I couldn't have said it better myself! Thanks!

  • Video decoding performed in hardware is more efficient than doing it on the system's CPU... This frees up resources that can be used elsewhere.

I know that VC-1 is a legacy codec and (luckily) no new content is released in VC-1, but as the user on Reddit wrote, there is still content available out there... and the hardware supports it! So why depcrecate and remove that capability?

@Zepmann

Zepmann commented May 3, 2026

Copy link
Copy Markdown

Tested this as a patch for an Arch Linux package building recipe based on package intel-media-driver. It works flawlessly on Arc A310.

@XinfengZhang, @guowillyy
I am not trying to interfere in your planning, but can you please give some indication on whether:

  1. This PR has a chance of being merged?
  2. An indication of when you have time to thoroughly review this and maybe merge it (if approved, of course)?

I see no disadvantages. My 2 cents:

  • The hardware supports this.
  • The code is fully open source, so I would say there is no conflict of interest.
  • Windows already supports VC-1 decoding on DG2. Why not Linux? 😃

@nyanmisaka

Copy link
Copy Markdown
Contributor Author

@Zepmann Unfortunately, Intel's own open-source collaboration methods differ significantly from similar projects like Mesa. If they have a reason not to support a deprecated feature and don't want to invest resources in testing, the code may never be merged, and you'll need to carry the patches yourself.

@XinfengZhang XinfengZhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I m not sure whether there is some risk that you replace current DG2 ISA with TGL one.

MHW_ASSERTMESSAGE("Create CM Hal interfaces failed.")
return MOS_STATUS_NO_SPACE;
}
#ifdef _MEDIA_RESERVED

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it means that these two kernel ISA will removed , why?

@nyanmisaka nyanmisaka Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two DG2 kernels have never been open sourced or upstreamed to this repo, so they are disabled by _MEDIA_RESERVED. Do you have any closed-source drivers using them internally?

m_cmhalDevice = device;
m_cmhalDevice->SetGenPlatformInfo(PLATFORM_INTEL_DG2, PLATFORM_INTEL_GT2, "DG2");
uint32_t cisaIDs[] = { GENX_DG2 , GENX_XEHP };
#ifdef _MEDIA_RESVERED

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks you are using TGL isa on DG2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was done intentionally. The last platform CM supported was TGLx. DG2's VC1 kernel contained GENX_TGLLP instead of GENX_DG2, and not doing so would cause CM to fail when loading and verifying the kernel.

m_cmhalDevice = device;
m_cmhalDevice->SetGenPlatformInfo(PLATFORM_INTEL_DG2, PLATFORM_INTEL_GT2, "DG2");
uint32_t cisaIDs[] = { GENX_DG2 , GENX_XEHP };
#ifdef _MEDIA_RESVERED

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
@nyanmisaka nyanmisaka force-pushed the enable-vc1dec-dg2 branch from 25fb926 to e47702f Compare June 2, 2026 04:17
@XinfengZhang

Copy link
Copy Markdown
Contributor

@nyanmisaka , thanks for contribution. about the PR, I still have 1 concern about changing CMHal from CmHalXe_Xpm;
to CM_HAL_G12_X, I actually not sure whether this cm HAL only used for OLP kernel or all kernels?

@nyanmisaka

Copy link
Copy Markdown
Contributor Author

@nyanmisaka , thanks for contribution. about the PR, I still have 1 concern about changing CMHal from CmHalXe_Xpm; to CM_HAL_G12_X, I actually not sure whether this cm HAL only used for OLP kernel or all kernels?

Other functions on the DG2 do not depend on the CM device - they are either already embedded in the hardware via Low-Power mode or are film-grain kernels in AV1 decoding that do not depend on the CM. VC1 OLP kernel is the only function that requires CM initialization.

Regarding reliability, we have a large number of users using Alchemist in their transcoding servers. We've included this patch in our own iHD driver build since 2024, and we haven't received any reports of a regression.

We cannot guarantee that we have tested each type of VC1 sample, so if you later find a regression, feel free to revert it.

@XinfengZhang XinfengZhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just like you mentioned , from my perspective, accepting new feature always means we should enlarge our test/release scope. but we will accept the feature enabling PR if there is real user, or someone's usage was blocked. maybe will not claim support on frontpage (is it ok for you? ) .
for this PR itself, from my personal perspective, VC1 should be deprecated, but just like your comments , someone is still using it. (actually, maybe I misunderstand something, looks the original request if for B580? it is battlemage), the PR is LGTM now.

@Zepmann

Zepmann commented Jun 2, 2026

Copy link
Copy Markdown

@XinfengZhang

I think whether a codec should be deprecated or not solely based on its age/usage is not a good discussion. DG2 also supports decoding of MPEG-2, which is even older and also rarely used these days. Furthermore, CPU's have no problem decoding MPEG-2 in software.

Instead, I would look at what the hardware can support. DG2 supports decoding of VC-1. It already does this in Windows. So why not support it in Linux? The hardware is there, the use cases are there (I also use this). Why not include it in the software?

I agree that it must be tested well and not cause regressions, of course. However, looking at @nyanmisaka and my experience with this patch, I would not expect trouble coming from this. And if in an obscure, untested scenario trouble occurs, the patch can always be reverted.

@nyanmisaka

Copy link
Copy Markdown
Contributor Author

just like you mentioned , from my perspective, accepting new feature always means we should enlarge our test/release scope. but we will accept the feature enabling PR if there is real user, or someone's usage was blocked. maybe will not claim support on frontpage (is it ok for you? ) . for this PR itself, from my personal perspective, VC1 should be deprecated, but just like your comments , someone is still using it. (actually, maybe I misunderstand something, looks the original request if for B580? it is battlemage), the PR is LGTM now.

I understand that not stating it in the README is a form of disclaimer. This is perfectly acceptable as community level support.

VC1 has been removed from Battlemage and similar Xe2+ platforms, making it impossible to enable using this method. Therefore, this PR is entirely Alchemist oriented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Decode video decode related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: VC-1 decoding support for DG2

5 participants