Closed Bug 1774271 Opened 3 years ago Closed 3 years ago

Pasted objects in pdf.js editor are sometimes empty or show rendering artifacts

Categories

(Core :: Widget: Gtk, defect, P1)

defect

Tracking

()

VERIFIED FIXED
104 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- unaffected
firefox101 --- unaffected
firefox102 --- unaffected
firefox103 --- verified
firefox104 --- fixed

People

(Reporter: marco, Assigned: stransky)

References

(Blocks 1 open bug, Regression, )

Details

(Keywords: regression)

Attachments

(4 files, 2 obsolete files)

STR:

  1. Enable PDF.js editing by setting pdfjs.annotationEditorEnabled to true
  2. Draw something somewhere
  3. Select what you drew
  4. Press CTRL+C
  5. Press CTRL+V

When pasting, sometimes the pasted content is empty or has artifacts.
It is easily reproducible if you press CTRL+V, then CTRL+Z to cancel the paste, then CTRL+V again in a loop.

Marco, can you please detail why you think this is a regression and what you think caused it?

Flags: needinfo?(mcastelluccio)

The bug isn't reproducible if you set gfx.canvas.accelerated to False, so it must be a regression of the GPU-accelerated canvas implementation.

Blocks: gpu-canvas
Flags: needinfo?(mcastelluccio)
Regressed by: 1770088
No longer regressed by: gpu-canvas

Can you please attach your about:support information?

Flags: needinfo?(mcastelluccio)

Set release status flags based on info from the regressing bug 1770088

No longer blocks: gfx-triage

I can repro this on X11+EGL and Wayland, but not on X11+GLX nor macOS (with accelerated canvas on). Same with bug 1774214, actually.

See Also: → 1774214

Is this a duplicate of bug 1773755? (Caused by bug 1735929 and fixed by bug 1773968?)

I could repro bug 1774214 with a rather old build (2022-01-01) but I didn't try this one.

Has Regression Range: --- → yes

If I change the thickness/width/height variables to be whole pixels it doesn't.

I can't repro with my test-case nor the original bug if I set widget.dmabuf-webgl.enabled=false (and restart). Can you confirm Marco?

Flags: needinfo?(mcastelluccio)

Yes, same here!

Flags: needinfo?(mcastelluccio)

Martin does this ring any bell? It seems something going very wrong with shared DMABuf surfaces.

Flags: needinfo?(stransky)

Ah, so at first I thought this was about the fractional stuff, but no, it's about the difference between width and height. Maybe a stride issue in the buffer or something? If in comment 9 I set width = 100 and height = 100 then there are no glitches.

So with mismatched width/height I get:

Unsupported modifier, resource creation failed.
XXX: resource creation failed

In the terminal, and glitches. With matched size I don't get that.

See Also: → 1767243
Attached file Simpler test-case.
Attachment #9281570 - Attachment is obsolete: true

I can reproduce that on Intel only, radeon and NVIDIA works ok.

On Fedora 36 I don't see

Unsupported modifier, resource creation failed.
XXX: resource creation failed

I suspect this is a bug in EGL_MESA_image_dma_buf_export where stride is not exported correctly or we don't import it correctly.
I think EGL_MESA_image_dma_buf_export is a bit fresh and not well tested (see Bug 1774075).

We can extend https://phabricator.services.mozilla.com/D149238 to disable EGL_MESA_image_dma_buf_export on Intel too.

Hm, I can find anything obviously wrong here - exported dmabuf params are the same on amd and Intel for with/height 100/200, stride is 512 in both cases. DRM format looks also ok - ABGR8888.

Flags: needinfo?(stransky)
Assignee: nobody → stransky
Component: Canvas: 2D → Widget: Gtk
Priority: -- → P2

(In reply to Darkspirit from comment #7)

Is this a duplicate of bug 1773755?

I'll leave that up to stransky/other developers working directly on this -- but FWIW, here a few relevant notes:

Regressed by: 1735929
No longer regressed by: 1770088

Also FWIW, I just tested a local debug+opt build with https://phabricator.services.mozilla.com/D149238 and https://phabricator.services.mozilla.com/D149608 (this bug's associated patch stack).

I can confirm that with that patch stack applied, I get the expected rendering on emilio's testcase here, on bug 1773755 (windy.com), bug 1774214 (web.whatsapp.com), and on my Synology NAS device's web UI.

Recent Firefox Nightly builds running on Linux X11 on Intel graphics (Fedora 35 64-bit, non-compositing window manager, i7-8700K onboard graphics) unpredictably render some Grafana dashboard panels in a completely garbled way. Bisecting with mozregression lands me on https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=145141e21a29ad02ea84392f9a5e51803e68a3b7&tochange=f9c796ae5117065116947d61b8fe2bcae1f6b78c and as a result this bug. A screenshot that looks like my experience is https://twitter.com/moderat10n/status/1538923071939063808. Not all panels on a Grafana dashboard are mis-rendered but usually some are, frequently graph panels.

Attachment #9281783 - Attachment is obsolete: true
Priority: P2 → P1

Also affects datadog dashboards on intel linux.
See this public dashboard for example: https://viarezo.fr/en/public_dashboard

:stansky just a reminder that Monday, June 27th is merge day for 103 to beta. If this will land before then?

Flags: needinfo?(stransky)

We need review first. [:jgilbert]?

Flags: needinfo?(stransky) → needinfo?(jgilbert)
Flags: needinfo?(jgilbert)
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/6dce488087f1 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD r=jgilbert
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

Comment on attachment 9282358 [details]
Bug 1774271 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD r?jgilbert

Beta/Release Uplift Approval Request

  • User impact if declined: Visual corruption when WebGL is used on Intel/AMD devices.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: Run testcase https://bugzilla.mozilla.org/attachment.cgi?id=9281575 in any Intel hardware and make sure the image is not corrupted.
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Fallback to old and tested WebGL/dmabuf surface creation on Intel/AMD.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9282358 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9282358 [details]
Bug 1774271 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD r?jgilbert

Approved for 103 beta 2, thanks.

Attachment #9282358 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Set release status flags based on info from the regressing bug 1735929

QA Whiteboard: [qa-triaged]

I tried to reproduce the issue on Ubuntu20.4 (wayland) having GPU: Intel(R) HD Graphics 530 and using build without the fix 103.0a1 (20220614213729) and the steps from description, but all I got was a bold drawing on both 'Simpler test-case' attached and on other pdf. Are there any other steps that I can try?
If not can you please confirm issue is not reproducing on latest Beta (https://archive.mozilla.org/pub/firefox/candidates/103.0b2-candidates/)? Thank you so much.

Flags: needinfo?(mcastelluccio)

I can't reproduce in Beta.

Flags: needinfo?(mcastelluccio)

Marked as verified based on comment #39.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: