Closed
Bug 618628
Opened 14 years ago
Closed 14 years ago
Optimize EGL backend for Maemo6
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fennec | - | --- |
People
(Reporter: romaxa, Assigned: romaxa)
References
Details
Attachments
(8 files, 13 obsolete files)
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
Two optimizations need to be enabled for Maemo6 EGL backend
1) UseBackingSurface = true
2) Fix EGLSurface creation and make LockSurface function working
Attachment #497099 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 1•14 years ago
|
||
Enable region clipping and transparent surface clearing.
Attachment #497102 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 2•14 years ago
|
||
Originally we had a bug about keeping EGL surface (drivers crash)
But that was fixed... so we can create EGL surface once and destroy it in DTOR
Attachment #497212 -
Flags: review?(jmuizelaar)
Updated•14 years ago
|
Attachment #497212 -
Flags: review?(jmuizelaar) → review+
Comment 3•14 years ago
|
||
Comment on attachment 497099 [details] [diff] [review]
EGL optimize for Maemo6
> #ifdef MOZ_X11
>-static EGLConfig
>-FindConfigForThebesXSurface(gfxASurface *aSurface, EGLSurface *aRetSurface)
>+EGLSurface
>+FindEGLSurfaceforXSurface(gfxASurface* aSurface, EGLConfig* aConfig)
Is FindEGLSurfaceforXSurface really a good name for this? i.e. does it actually search for a EGL Surface or just create it?
Also, "for" is not capitalized.
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #497099 -
Attachment is obsolete: true
Attachment #497779 -
Flags: review?(jmuizelaar)
Attachment #497099 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 5•14 years ago
|
||
Attachment #497102 -
Attachment is obsolete: true
Attachment #497779 -
Attachment is obsolete: true
Attachment #498323 -
Flags: review?(vladimir)
Attachment #497102 -
Flags: review?(jmuizelaar)
Attachment #497779 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 6•14 years ago
|
||
Direct rendering into locked texture with better clipping
Attachment #498324 -
Flags: review?(vladimir)
Assignee | ||
Comment 7•14 years ago
|
||
Attachment #498325 -
Flags: review?(vladimir)
Assignee | ||
Comment 8•14 years ago
|
||
Attachment #498325 -
Attachment is obsolete: true
Attachment #498326 -
Flags: review?(vladimir)
Attachment #498325 -
Flags: review?(vladimir)
Assignee | ||
Comment 9•14 years ago
|
||
Fix shader program type to RGB in case of backing surface available
Assignee: nobody → romaxa
Attachment #498323 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #498327 -
Flags: review?(vladimir)
Attachment #498323 -
Flags: review?(vladimir)
Assignee | ||
Comment 10•14 years ago
|
||
KHR image detection is broken....
on maemo5 we have KHR image but don't have KHRimage from pixmap.
Attachment #498579 -
Flags: review?(vladimir)
Assignee | ||
Comment 11•14 years ago
|
||
I have often error, caused by creating XPixmap without XSync and calling EGL functionality with non-existing pixmap.
Attachment #498580 -
Flags: review?(vladimir)
Could you move all these reviews to jeff? He's doing most of the work on the mobile GL stuff lately..
Assignee | ||
Updated•14 years ago
|
Attachment #498579 -
Flags: review?(vladimir) → review?(jmuizelaar)
Assignee | ||
Updated•14 years ago
|
Attachment #498580 -
Flags: review?(vladimir) → review?(jmuizelaar)
Assignee | ||
Updated•14 years ago
|
Attachment #498326 -
Flags: review?(vladimir) → review?(jmuizelaar)
Assignee | ||
Comment 13•14 years ago
|
||
Comment on attachment 498324 [details] [diff] [review]
Probably obsolete, but nice to have this API working
Need to recheck this patch, something wrong here
Attachment #498324 -
Flags: review?(vladimir)
Assignee | ||
Comment 14•14 years ago
|
||
Comment on attachment 498327 [details] [diff] [review]
UseBackingStore for Maemo6 + 16bpp format type
Need recheck this patch once again... still have some problems with BltTexture on not-resized (created) texture.
Attachment #498327 -
Flags: review?(vladimir)
Assignee | ||
Comment 15•14 years ago
|
||
Attachment #498324 -
Attachment is obsolete: true
Attachment #498327 -
Attachment is obsolete: true
Attachment #498988 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 16•14 years ago
|
||
Attachment #498989 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 17•14 years ago
|
||
Attachment #499030 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 18•14 years ago
|
||
Attachment #498326 -
Attachment is obsolete: true
Attachment #499093 -
Flags: review?(jmuizelaar)
Attachment #498326 -
Flags: review?(jmuizelaar)
Updated•14 years ago
|
Attachment #498579 -
Flags: review?(jmuizelaar) → review+
Comment 19•14 years ago
|
||
Comment on attachment 498580 [details] [diff] [review]
XSync before use EGL
Please add a comment about why the XSync() is needed here.
Attachment #498580 -
Flags: review?(jmuizelaar) → review-
Assignee | ||
Comment 20•14 years ago
|
||
> Please add a comment about why the XSync() is needed here.
hmm, in order to avoid crash, or bad initialized EGL surface with this error message:
https://bugzilla.mozilla.org/show_bug.cgi?id=593880#c0
Assignee | ||
Comment 21•14 years ago
|
||
I think just created X Surface not correctly registered and initialized for working with EGL... so XSync was the only solution to avoid GetGeometry: BadDrawable error message
Assignee | ||
Comment 22•14 years ago
|
||
Attachment #498580 -
Attachment is obsolete: true
Attachment #500911 -
Flags: review?(jmuizelaar)
Updated•14 years ago
|
Attachment #500911 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 23•14 years ago
|
||
I think it is better to get approval for this bug.. and get these patches integrated in order to make mozilla working on latest SGX drivers. with latest lock extensions et.c.
tracking-fennec: --- → ?
Updated•14 years ago
|
Attachment #499030 -
Flags: review?(jmuizelaar) → review+
Comment 24•14 years ago
|
||
Comment on attachment 498988 [details] [diff] [review]
BeginUpdate clip + transparency for backingSurface mode
Can you give more detail on what this patch is for?
Updated•14 years ago
|
tracking-fennec: ? → 2.0-
Updated•14 years ago
|
Attachment #498989 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 25•14 years ago
|
||
> BeginUpdate clip + transparency for backingSurface mode
> Can you give more detail on what this patch is for?
Actually this fix is similar to bug 621778, paint regions instead of region bounding rect.
Another part is clearing surface before rendering transparent content... otherwise we will see overlapping Text thebesLayers in awesomebar and settings menu
Assignee | ||
Comment 26•14 years ago
|
||
Attachment #502117 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 27•14 years ago
|
||
dougt: why b-f was rejected here? we need this in order to get EGL working on recent SGX drivers... from another point of view it is almost NPODB...
Comment 28•14 years ago
|
||
2.0 is not blocking on maemo6. Please just request approval2.0 and you will get a stamp. also, yes, if this is all NPODB, no approval required.
Comment 29•14 years ago
|
||
Comment on attachment 498988 [details] [diff] [review]
BeginUpdate clip + transparency for backingSurface mode
>
> //printf_stderr("BeginUpdate with updateRect [%d %d %d %d]\n", mUpdateRect.x, mUpdateRect.y, mUpdateRect.width, mUpdateRect.height);
>
> // We can only draw a rectangle, not subregions due to
> // the way that our texture upload functions work. If
> // needed, we /could/ do multiple texture uploads if we have
> // non-overlapping rects, but that's a tradeoff.
Update the comment.
>- aRegion = nsIntRegion(mUpdateRect);
>+ if (!mCreated)
>+ aRegion = nsIntRegion(mUpdateRect);
>
It probably makes more sense to unify this with the code above.
>- nsIntSize rgnSize = mUpdateRect.Size();
> if (!nsIntRect(nsIntPoint(0, 0), mSize).Contains(mUpdateRect)) {
> NS_ERROR("update outside of image");
> return NULL;
> mUpdateContext = new gfxContext(mBackingSurface);
> }
>+
>+ nsIntRegionRectIterator iter(aRegion);
>+ const nsIntRect* rect;
>+ while ((rect = iter.Next())) {
>+ mUpdateContext->Rectangle(gfxRect(rect->x, rect->y, rect->width, rect->height),
>+ PR_TRUE);
>+ }
>+ mUpdateContext->Clip();
gfxUtils::ClipToRegion()
Attachment #498988 -
Flags: review?(jmuizelaar) → review-
Comment 30•14 years ago
|
||
Comment on attachment 499093 [details] [diff] [review]
No clear required, Optimize DirectUpdate API to use lock extension
>+ nsIntRegionRectIterator iter(aRegion);
>+ const nsIntRect* rect;
>+ while ((rect = iter.Next())) {
>+ mUpdateContext->Rectangle(gfxRect(rect->x, rect->y, rect->width, rect->height),
>+ PR_TRUE);
>+ }
>+ mUpdateContext->Clip();
ClipToRegion()
>+ mUpdateContext->SetSource(aSurf);
>+ mUpdateContext->SetOperator(gfxContext::OPERATOR_SOURCE);
>+ mUpdateContext->Paint();
>+ mUpdateContext = nsnull;
>+ UnlockSurface();
>+ mCreated = PR_TRUE;
>+ return true;
I don't really like unnecessary return's in the middle of functions.
Attachment #499093 -
Flags: review?(jmuizelaar) → review-
Comment 31•14 years ago
|
||
Comment on attachment 502117 [details] [diff] [review]
Use backing surface for maemo (EGL X)
> mUpdateFormat = gfxASurface::FormatFromContent(GetContentType());
>
>+ if (gUseBackingSurface) {
>+ if (mUpdateFormat == gfxASurface::ImageFormatRGB24) {
>+#ifdef MOZ_GFX_OPTIMIZE_MOBILE
>+ mUpdateFormat = gfxASurface::ImageFormatRGB16_565;
>+ mShaderType = RGBXLayerProgramType;
>+#else
>+ mUpdateFormat = gfxASurface::ImageFormatARGB32;
>+ mShaderType = RGBALayerProgramType;
>+#endif
>+ } else {
>+ mShaderType = RGBALayerProgramType;
>+ }
>+ CreateBackingSurface(gfxIntSize(aSize.width, aSize.height));
>+ return;
>+ }
I think this would be better without the return in the middle.
> virtual ~TextureImageEGL()
> {
> GLContext *ctx = mGLContext;
> if (ctx->IsDestroyed() || !NS_IsMainThread()) {
>@@ -1246,32 +1261,32 @@ public:
>
> virtual void Resize(const nsIntSize& aSize)
> {
> NS_ASSERTION(!mUpdateContext, "Resize() while in update?");
>
> if (mSize == aSize && mCreated)
> return;
>
>+ mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
> if (mBackingSurface) {
> CreateBackingSurface(gfxIntSize(aSize.width, aSize.height));
> } else {
>- mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
> mGLContext->fTexImage2D(LOCAL_GL_TEXTURE_2D,
> 0,
> GLFormatForImage(mUpdateFormat),
> aSize.width,
> aSize.height,
> 0,
> GLFormatForImage(mUpdateFormat),
> GLTypeForImage(mUpdateFormat),
> NULL);
>+ mCreated = PR_TRUE;
> }
I'm little worried about the different state (mCreated etc.) associated with these two styles of objects.
Can you separate out the state associated with mBackingSurface contexts and those without?
Attachment #502117 -
Flags: review?(jmuizelaar) → review-
Assignee | ||
Comment 32•14 years ago
|
||
Attachment #498988 -
Attachment is obsolete: true
Attachment #502785 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 33•14 years ago
|
||
Attachment #499093 -
Attachment is obsolete: true
Attachment #502786 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 34•14 years ago
|
||
>Can you separate out the state associated with mBackingSurface contexts and
>those without?
No sure that I fully understand what do you mean here...
do you want if condition which does completely separate things for mBackingSurface and !mBackingSurface ?
Attachment #502117 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Attachment #502804 -
Flags: review?(jmuizelaar)
Comment 35•14 years ago
|
||
Comment on attachment 502785 [details] [diff] [review]
BeginUpdate clip + transparency for backingSurface mode. r2
>- // We can only draw a rectangle, not subregions due to
>- // the way that our texture upload functions work. If
>- // needed, we /could/ do multiple texture uploads if we have
>- // non-overlapping rects, but that's a tradeoff.
>- aRegion = nsIntRegion(mUpdateRect);
>-
>- nsIntSize rgnSize = mUpdateRect.Size();
Isn't this still true if !mBackingSurface?
Updated•14 years ago
|
Attachment #502786 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 36•14 years ago
|
||
oh, I though that 621778 covering this problem and already fixed...
Attachment #502785 -
Attachment is obsolete: true
Attachment #503075 -
Flags: review?(jmuizelaar)
Attachment #502785 -
Flags: review?(jmuizelaar)
Comment 37•14 years ago
|
||
Comment on attachment 503075 [details] [diff] [review]
BeginUpdate clip + transparency for backingSurface mode. r3
> mUpdateRect = aRegion.GetBounds();
>+ if (!mBackingSurface) {
>+ aRegion = nsIntRegion(mUpdateRect);
>+ }
It seems weird to update mUpdateRect based on aRegion.GetBounds() and then go back and update aRegion. Do we need both?
Assignee | ||
Comment 38•14 years ago
|
||
> It seems weird to update mUpdateRect based on aRegion.GetBounds() and then go
> back and update aRegion. Do we need both?
yes, mUpdateRect used in EndUpdate... aRegion used for understanding which area need to be repainted.
Comment 39•14 years ago
|
||
(In reply to comment #38)
> yes, mUpdateRect used in EndUpdate... aRegion used for understanding which area
> need to be repainted.
Can we fix that?
Assignee | ||
Comment 40•14 years ago
|
||
> > need to be repainted.
> Can we fix that?
This is not bug, it is feature, because ThebesBuffer code does not track is texture fully painted or not, or is texture support region painting... it just suggesting Region in BeginUpdate and BeginUpdate can correct region according to texture state or region filling support.
Updated•14 years ago
|
Attachment #502804 -
Flags: review?(jmuizelaar) → review+
Updated•14 years ago
|
Attachment #503075 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 41•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•