public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Martin Stransky <stransky@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/firefox] f43: Backported fix for HDR crash when HLG transform is missing (and it's always missing!)
Date: Fri, 21 Aug 2026 08:01:04 GMT	[thread overview]
Message-ID: <178729926466.1.17035754299227683448.rpms-firefox-38e2082ab3a1@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/firefox
Branch : f43
Commit : 38e2082ab3a1e1600be49511643c27fe4b9711c0
Author : Martin Stransky <stransky@redhat.com>
Date   : 2026-08-21T10:00:33+02:00
Stats  : +86/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/firefox/c/38e2082ab3a1e1600be49511643c27fe4b9711c0?branch=f43

Log:
Backported fix for HDR crash when HLG transform is missing (and it's always missing!)

---
diff --git a/D317117.1787384850.diff b/D317117.1787384850.diff
new file mode 100644
index 0000000..9871913
--- /dev/null
+++ b/D317117.1787384850.diff
@@ -0,0 +1,79 @@
+diff -up firefox-154.0/widget/gtk/nsWaylandDisplay.cpp.D317117 firefox-154.0/widget/gtk/nsWaylandDisplay.cpp
+--- firefox-154.0/widget/gtk/nsWaylandDisplay.cpp.D317117	2026-08-12 23:13:46.000000000 +0200
++++ firefox-154.0/widget/gtk/nsWaylandDisplay.cpp	2026-08-21 09:51:45.131779412 +0200
+@@ -1347,4 +1347,13 @@ void nsWaylandDisplay::Init() {
+   }
+ }
+ 
++bool nsWaylandDisplay::IsTFSupported(int aTF) {
++  if (aTF < sColorTransfersNum) {
++    return mSupportedTransfer[aTF] == aTF;
++  } else {
++    NS_WARNING("Unknow color transfer function!");
++    return false;
++  }
++}
++
+ }  // namespace mozilla::widget
+diff -up firefox-154.0/widget/gtk/nsWaylandDisplay.h.D317117 firefox-154.0/widget/gtk/nsWaylandDisplay.h
+--- firefox-154.0/widget/gtk/nsWaylandDisplay.h.D317117	2026-08-12 23:13:46.000000000 +0200
++++ firefox-154.0/widget/gtk/nsWaylandDisplay.h	2026-08-21 09:51:45.131642320 +0200
+@@ -197,6 +197,8 @@ class nsWaylandDisplay {
+   MonitorConfig* GetMonitorConfig(int x, int y);
+   bool RemoveMonitorConfig(int aId);
+ 
++  bool IsTFSupported(int aTF);
++
+   ~nsWaylandDisplay();
+ 
+  private:
+diff -up firefox-154.0/widget/gtk/WaylandSurface.cpp.D317117 firefox-154.0/widget/gtk/WaylandSurface.cpp
+--- firefox-154.0/widget/gtk/WaylandSurface.cpp.D317117	2026-08-12 23:13:47.000000000 +0200
++++ firefox-154.0/widget/gtk/WaylandSurface.cpp	2026-08-21 09:58:48.531193706 +0200
+@@ -1545,28 +1545,36 @@ bool WaylandSurface::EnableColorManageme
+           params, WP_COLOR_MANAGER_V1_PRIMARIES_SRGB);
+       break;
+   }
++  uint32_t requiredTF = 0;
+   switch (aTransferFunction) {
+     case gfx::TransferFunction::PQ:
+-      wp_image_description_creator_params_v1_set_tf_named(
+-          params, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ);
++      requiredTF = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_ST2084_PQ;
+       break;
+     case gfx::TransferFunction::HLG:
+-      wp_image_description_creator_params_v1_set_tf_named(
+-          params, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_HLG);
++      requiredTF = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_HLG;
+       break;
+     case gfx::TransferFunction::BT709:
+-      wp_image_description_creator_params_v1_set_tf_named(
+-          params, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_BT1886);
++      requiredTF = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_BT1886;
+       break;
+     case gfx::TransferFunction::SRGB:
+-      wp_image_description_creator_params_v1_set_tf_named(
+-          params, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB);
++      requiredTF = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_SRGB;
+       break;
+     case gfx::TransferFunction::LINEAR:
+-      wp_image_description_creator_params_v1_set_tf_named(
+-          params, WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR);
++      requiredTF = WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR;
+       break;
+   }
++
++  if (requiredTF == 0 || !WaylandDisplayGet()->IsTFSupported(requiredTF)) {
++    LOGWAYLAND("Transfer function %u isn't supported.", requiredTF);
++
++    wp_image_description_creator_params_v1_destroy(params);
++    mColorSurface = nullptr;
++
++    return false;
++  }
++
++  wp_image_description_creator_params_v1_set_tf_named(params, requiredTF);
++
+   mImageDescription = wp_image_description_creator_params_v1_create(params);
+   // wp_image_description_creator_params_v1_create() consumes params
+   params = nullptr;

diff --git a/firefox.spec b/firefox.spec
index d94031d..8fefc03 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -186,7 +186,7 @@ ExcludeArch: i686
 Summary:        Mozilla Firefox Web browser
 Name:           firefox
 Version:        154.0
-Release:        3%{?pre_tag}%{?dist}
+Release:        4%{?pre_tag}%{?dist}
 URL:            https://www.mozilla.org/firefox/
 # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended.
 License:        LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+
@@ -255,6 +255,7 @@ Patch242:        0026-Add-KDE-integration-to-Firefox.patch
 # Upstream patches
 Patch400:        mozilla-1196777.patch
 Patch401:        mozilla-1667096.patch
+Patch402:        D317117.1787384850.diff
 
 # https://phabricator.services.mozilla.com/D312871
 # Drop with Firefox 156
@@ -542,6 +543,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-30/build/sysr
 
 %patch -P400 -p1 -b .1196777
 %patch -P401 -p1 -b .1667096
+%patch -P402 -p1 -b .D317117
 
 %patch -P410 -p1 -b .libwebrtc-video-capture-implement-buffer-stride-support-for-pipewire
 
@@ -1211,6 +1213,10 @@ fi
 #---------------------------------------------------------------------
 
 %changelog
+* Fri Aug 21 2026 Martin Stransky <stransky@redhat.com> - 154.0-4
+- Backported fix for HDR crash when HLG transform is missing
+  (and it's always missing!).
+
 * Tue Aug 18 2026 Jan Grulich <jgrulich@redhat.com> - 154.0-3
 - WebRTC backport: video_capture - implement buffer stride support for PipeWire
 

                 reply	other threads:[~2026-08-21  8:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178729926466.1.17035754299227683448.rpms-firefox-38e2082ab3a1@fedoraproject.org \
    --to=stransky@redhat.com \
    --cc=git-commits@fedoraproject.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox