[GS] Allow texturing for X22UD SoC 57/322957/2
authorJakub Gajownik <j.gajownik2@samsung.com>
Thu, 10 Apr 2025 16:35:03 +0000 (18:35 +0200)
committerBot Blink <blinkbot@samsung.com>
Tue, 22 Apr 2025 13:14:32 +0000 (13:14 +0000)
Due to recent change on drivers level, it's now possible
to use texturing on X22UD products. To get valid data from
the hardware decoder, we need to set additional flag to
notify it about needed format translation.
Note that it is usable on newest product only, so need
for GPU workaround to dynamically detect applicable
environment. For others, texturing should still be disabled.

This reverts edef3601ee127144faca80e81c3aa5065d7df97b:
"[WebRTC][GS] Disable texturing on X22UD products"

Bug: https://jira-eu.sec.samsung.net/browse/VDGAME-686
Change-Id: I856fc2b77a7aabd904029fb09827b2ac7ec1b91f
Signed-off-by: Jakub Gajownik <j.gajownik2@samsung.com>
gpu/config/gpu_driver_bug_list.json
gpu/config/gpu_workaround_list.txt
media/filters/tizen/decoder_facade_video.h
media/filters/tizen/omx/omx_facade_video.cc
media/filters/tizen/omx/omx_facade_video.h
media/filters/tizen/omx/omx_facade_video_test.cc
media/filters/tizen/ttvd_video_decoder_base.cc
media/filters/tizen/ttvd_video_decoder_impl.cc

index 0cad44f7df9918da543fcaf25a1f411a0478912d..df4fcd3101f7cbd871c571432701d9d04e82e8a8 100644 (file)
         "type": "linux"
       },
       "machine_model_name": ["X22UD"],
+      "machine_model_version": {
+        "op": "=",
+        "value": "23"
+      },
       "features": [
         "disable_ttvd_texturing"
       ]
       "features": [
         "ttvd_disable_manual_rendering"
       ]
+    },
+    {
+      "id": 435,
+      "description": "Some SoCs might need additional setting to give proper decoded data for texturing, but overlay mode stops work then",
+      "os": {
+        "type": "linux"
+      },
+      "machine_model_name": ["X22UD"],
+      "machine_model_version": {
+        "op": ">=",
+        "value": "25"
+      },
+      "features": [
+        "ttvd_texturing_breaks_overlay_mode"
+      ]
     }
   ]
 }
index c584f390452485313c44ee2c3650be9c17b3c351..fdb1b744411287955dc22e9f1d5b42d05b0cd459 100644 (file)
@@ -112,6 +112,7 @@ ttvd_disable_buffer_parallel_copy
 ttvd_disable_faster_decoder_selection
 ttvd_disable_manual_rendering
 ttvd_prefer_manual_rendering_for_low_latency
+ttvd_texturing_breaks_overlay_mode
 scalarize_vec_and_mat_constructor_args
 supports_two_yuv_hardware_overlays
 unbind_attachments_on_bound_render_fbo_delete
index 22cfacda452449ca97a06e82b91d12e37a759907..469d7755bedf91618291ea0e222721500f80c468 100644 (file)
 
 namespace media {
 
+enum class ForceTexturingOnlyMode {
+  kNo,
+  // Force usage of texture only mode for decoder. Client won't be able to
+  // render decoded data using direct rendering mode with overlay.
+  kYes,
+};
+
 class DecoderFacadeVideo : virtual public DecoderFacade {
  public:
   struct OutputData {
@@ -53,6 +60,7 @@ class DecoderFacadeVideo : virtual public DecoderFacade {
                           LatencyMode latency_mode,
                           bool secure_mode,
                           DecodingMode decoding_mode,
+                          ForceTexturingOnlyMode texturing_only_mode,
                           const std::string& component_name,
                           DecoderFacade::InitCB init_cb,
                           const DecoderFacade::InputCB& input_cb,
index 05394cc3601d39cb47f04f902bd453763b162005..6d6ba98883a4c3c53bb429f39c03041659277efb 100644 (file)
@@ -141,6 +141,7 @@ void OmxFacadeVideo::Initialize(MediaVideoCodec codec,
                                 LatencyMode latency_mode,
                                 bool secure_mode,
                                 DecodingMode decoding_mode,
+                                ForceTexturingOnlyMode texturing_only_mode,
                                 const std::string& component_name,
                                 OmxFacade::InitCB init_cb,
                                 const OmxFacade::InputCB& input_cb,
@@ -153,6 +154,7 @@ void OmxFacadeVideo::Initialize(MediaVideoCodec codec,
   coded_size_ = coded_size;
   latency_mode_ = latency_mode;
   decoding_mode_ = decoding_mode;
+  texturing_only_mode_ = texturing_only_mode;
   output_cb_ = output_cb;
   hdr_metadata_cb_ = hdr_cb;
   color_space_cb_ = color_space_cb;
@@ -226,8 +228,9 @@ bool OmxFacadeVideo::SetComponentConfiguration(
   param.bErrorConcealment = OMX_FALSE;
 
   const bool is_mfc = component_name.find("mfc") != std::string::npos;
-  if (is_mfc && latency_mode_ != LatencyMode::kNormal &&
-      workarounds_.ttvd_prefer_manual_rendering_for_low_latency) {
+  if (is_mfc && ((latency_mode_ != LatencyMode::kNormal &&
+                  workarounds_.ttvd_prefer_manual_rendering_for_low_latency) ||
+                 texturing_only_mode_ == ForceTexturingOnlyMode::kYes)) {
     param.bNoVideoOut = OMX_TRUE;
   }
 
index 1ccbfa7ecca9953c9e34bc3a95c401db1cad5989..414152ef6f9d005bc72ad5e12b020b2a7f51d0af 100644 (file)
@@ -26,6 +26,7 @@ class OmxFacadeVideo : public DecoderFacadeVideo, public OmxFacade {
                   LatencyMode latency_mode,
                   bool secure_mode,
                   DecodingMode decoding_mode,
+                  ForceTexturingOnlyMode texturing_only_mode,
                   const std::string& component_name,
                   OmxFacade::InitCB init_cb,
                   const OmxFacade::InputCB& input_cb,
@@ -57,6 +58,7 @@ class OmxFacadeVideo : public DecoderFacadeVideo, public OmxFacade {
   gfx::Size coded_size_;
   LatencyMode latency_mode_;
   DecodingMode decoding_mode_;
+  ForceTexturingOnlyMode texturing_only_mode_;
   OutputCB output_cb_;
 
   HdrMetadataCB hdr_metadata_cb_;
index ea5f2bcb4cd8e85350ce1daee92b18744bd9f980..8e3891f067ee0e7ffee1367d365bf7fb6fc93590 100644 (file)
@@ -103,7 +103,8 @@ class OmxFacadeVideoTest : public testing::Test {
 
     facade_->Initialize(
         MediaVideoCodec::kCodecH264, gfx::Size(1, 1), LatencyMode::kNormal,
-        false, DecodingMode::kDecodingNormal, "testing",
+        false, DecodingMode::kDecodingNormal, ForceTexturingOnlyMode::kNo,
+        "testing",
         base::BindOnce(
             [](bool* result, base::RunLoop* run_loop, bool init_result) {
               *result = init_result;
index e058aa3604162c891a4f7a59bde9555bc4b97a15..d5ae7ca039c23346e98e4ab306c257cd09e0f532 100644 (file)
@@ -97,7 +97,7 @@ void TTvdVideoDecoderBase::Initialize(MediaVideoCodec codec,
   decoder_facade_->Initialize(
       codec, coded_size, low_delay ? LatencyMode::kLow : LatencyMode::kNormal,
       false /* secure_mode */, allocated_decoder_->decoding_mode,
-      allocated_decoder_->component_name,
+      ForceTexturingOnlyMode::kNo, allocated_decoder_->component_name,
       base::BindOnce(&TTvdVideoDecoderBase::OnInitDone,
                      weak_factory_.GetWeakPtr()),
       base::BindRepeating(&TTvdVideoDecoderBase::OnInputDone,
index a82c89744b218746855edf9b3e8e63a28ce5218b..b1d66b90b884ff1b90bfab8577945105fbcdce57 100644 (file)
@@ -1618,7 +1618,11 @@ void TTvdVideoDecoderImpl::InitializeFacade() {
   const bool is_secure_mode = cdm_bridge_ != nullptr;
   decoder_facade_->Initialize(
       codec, config_.visible_rect().size(), FacadeLatencyMode(), is_secure_mode,
-      allocated_decoder_->decoding_mode, allocated_decoder_->component_name,
+      allocated_decoder_->decoding_mode,
+      workarounds_.ttvd_texturing_breaks_overlay_mode && supports_texturing_
+          ? ForceTexturingOnlyMode::kYes
+          : ForceTexturingOnlyMode::kNo,
+      allocated_decoder_->component_name,
       base::BindOnce(&TTvdVideoDecoderImpl::OnInitializationDone,
                      weak_factory_.GetWeakPtr()),
       base::BindRepeating(&TTvdVideoDecoderImpl::OnBufferEmptied,
@@ -2435,6 +2439,24 @@ void TTvdVideoDecoderImpl::UpdateDecoderCapabilities() {
     }
   }
 
+  if (supports_texturing && supports_overlay_ &&
+      workarounds_.ttvd_texturing_breaks_overlay_mode) {
+    // Some SoC requires additional setting to allow getting proper raw data
+    // from hardware decoder. Additionally, this setting will disable
+    // possibility of using overlay mode, so we need to decide here which mode
+    // should be used.
+
+    if (config_.needs_raw_access()) {
+      // In case of WebCodecs (or any other that requires access to decoded
+      // data), prefer texturing instead overlay if we cannot have both.
+      TIZEN_MEDIA_LOG(INFO) << "Disable overlay support";
+      supports_overlay_ = false;
+    } else {
+      TIZEN_MEDIA_LOG(INFO) << "Disable texturing support";
+      supports_texturing = false;
+    }
+  }
+
   TIZEN_MEDIA_LOG(VERBOSE) << "Texturing: " << supports_texturing
                            << ", overlay: " << supports_overlay_;