RESOLVED FIXED 235526
[iOS] Avoid calling IOSurfaceGetPropertyMaximum
https://bugs.webkit.org/show_bug.cgi?id=235526
Summary [iOS] Avoid calling IOSurfaceGetPropertyMaximum
Per Arne Vollan
Reported 2022-01-24 09:38:03 PST
There should be no need to call IOSurfaceGetPropertyMaximum on iOS, since the return value will exceed the hardcoded maximum.
Attachments
Patch (2.15 KB, patch)
2022-01-24 09:40 PST, Per Arne Vollan
no flags
Patch (2.55 KB, patch)
2022-01-24 10:44 PST, Per Arne Vollan
no flags
Patch (2.55 KB, patch)
2022-01-24 10:49 PST, Per Arne Vollan
simon.fraser: review+
Patch (2.64 KB, patch)
2022-01-24 12:32 PST, Per Arne Vollan
no flags
Patch (2.76 KB, patch)
2022-01-24 15:12 PST, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2022-01-24 09:40:16 PST
Per Arne Vollan
Comment 2 2022-01-24 10:44:17 PST
Per Arne Vollan
Comment 3 2022-01-24 10:49:08 PST
Per Arne Vollan
Comment 4 2022-01-24 11:10:10 PST
Thanks for reviewing!
Per Arne Vollan
Comment 5 2022-01-24 11:10:30 PST
Darin Adler
Comment 6 2022-01-24 12:23:48 PST
Comment on attachment 449826 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449826&action=review > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:235 > + const int maxSurfaceDimension = 8 * 1024; constexpr > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:242 > const int maxSurfaceDimensionLowerBound = 1024; constexpr > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:244 > // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. I don’t understand how this comment relates to the code below, which does not return INT_MAX. > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:245 > const int maxSurfaceDimension = 32 * 1024; constexpr
Per Arne Vollan
Comment 7 2022-01-24 12:32:53 PST
Per Arne Vollan
Comment 8 2022-01-24 12:33:54 PST
(In reply to Darin Adler from comment #6) > Comment on attachment 449826 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449826&action=review > > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:235 > > + const int maxSurfaceDimension = 8 * 1024; > > constexpr > > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:242 > > const int maxSurfaceDimensionLowerBound = 1024; > > constexpr > > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:244 > > // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. > > I don’t understand how this comment relates to the code below, which does > not return INT_MAX. > Removed what seems to be an obsolete comment. > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:245 > > const int maxSurfaceDimension = 32 * 1024; > > constexpr Fixed! Thanks for reviewing!
Darin Adler
Comment 9 2022-01-24 13:50:11 PST
Comment on attachment 449843 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449843&action=review > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:231 > +static IntSize maxSurfaceDimensionCA() Should be static constexpr IntSize. Unless the IntSize constructor is not constexpr, which it should be, but at that point it’s obviously too much for just this patch. > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:-242 > - // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. Oh, wait, I figured out what this might have meant: If hardware acceleration is unavailable, IOSurface::maximumSize() can return "infinity", but we still want to impose a maximum in that case.
Per Arne Vollan
Comment 10 2022-01-24 15:12:22 PST
Per Arne Vollan
Comment 11 2022-01-24 15:14:19 PST
(In reply to Darin Adler from comment #9) > Comment on attachment 449843 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449843&action=review > > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:231 > > +static IntSize maxSurfaceDimensionCA() > > Should be static constexpr IntSize. Unless the IntSize constructor is not > constexpr, which it should be, but at that point it’s obviously too much for > just this patch. > Fixed. > > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:-242 > > - // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. > > Oh, wait, I figured out what this might have meant: > > If hardware acceleration is unavailable, IOSurface::maximumSize() can return > "infinity", but we still want to impose a maximum in that case. I put the comment back in. Thanks for reviewing!
EWS
Comment 12 2022-01-24 17:03:53 PST
Committed r288489 (246363@main): <https://commits.webkit.org/246363@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449870 [details].
Simon Fraser (smfr)
Comment 13 2022-01-26 13:39:47 PST
Why did we need this after https://trac.webkit.org/changeset/270392/webkit? We should send this from the UI Process already.
Per Arne Vollan
Comment 14 2022-01-26 13:42:36 PST
(In reply to Simon Fraser (smfr) from comment #13) > Why did we need this after https://trac.webkit.org/changeset/270392/webkit? > We should send this from the UI Process already. This will avoid the perf regression from https://trac.webkit.org/changeset/270392/webkit, I believe.
Simon Fraser (smfr)
Comment 15 2022-01-26 13:44:10 PST
Bug 219484 has no mention of a revert or perf regression.
Per Arne Vollan
Comment 16 2022-01-26 13:54:24 PST
(In reply to Simon Fraser (smfr) from comment #15) > Bug 219484 has no mention of a revert or perf regression. Yes, although I believe it was a launch time regression. Looking at WebProcessPoolCocoa.mm, I see: // However, querying this is a launch time regression, so limit this to only the necessary case. if (m_defaultPageGroup->preferences().useGPUProcessForDOMRenderingEnabled()) parameters.maximumIOSurfaceSize = WebCore::IOSurface::maximumSize();
Simon Fraser (smfr)
Comment 17 2022-01-26 14:02:47 PST
...which blames to bug 221346 so let's relate the bugs.
Note You need to log in before you can comment on or make changes to this bug.