gbm_dri_bo_create fails to initialize bo->base.base.format

Bug #1112147 reported by Daniel van Vugt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mesa
Fix Released
Medium
mesa (Ubuntu)
Fix Released
Medium
Timo Aaltonen
Quantal
Won't Fix
Undecided
Unassigned
Raring
Fix Released
Medium
Timo Aaltonen

Bug Description

Calling gbm_bo_create() with format == GBM_BO_FORMAT_ARGB8888 completes successfully. However reading back the format via gbm_bo_get_format() returns GBM_BO_FORMAT_XRGB8888.

The problem seems to be that the bo internal structure is initialized to zero by calloc, but the format field is never set by gbm_dri_bo_create, so it stays zero (GBM_BO_FORMAT_XRGB8888) even when the real image format is something different.

Tags: raring
Revision history for this message
In , Daniel van Vugt (vanvugt) wrote :

Calling gbm_bo_create() with format == GBM_BO_FORMAT_ARGB8888 completes successfully. However reading back the format via gbm_bo_get_format() returns GBM_BO_FORMAT_XRGB8888.

The problem seems to be that the bo internal structure is initialized to zero by calloc, but the format field is never set by gbm_dri_bo_create, so it stays zero (GBM_BO_FORMAT_XRGB8888) even when the real image format is something different.

Should be a simple fix in gbm_dri_bo_create(). Just add:
  bo->base.base.format = gbm_dri_to_gbm_format(dri_format);

Revision history for this message
Elaina March (marieemarch) wrote :

Please update with Version, application and any other information and add a questions unless this is a fix or opinion

Changed in mesa (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That information is not required. I have reproduced the bug on quantal and raring, and found the bug in the upstream source code. Testing a fix now.

Changed in mesa (Ubuntu):
status: Incomplete → In Progress
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in mesa:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mesa (Ubuntu):
importance: Undecided → Medium
Revision history for this message
In , Daniel van Vugt (vanvugt) wrote :

Or even simpler fix...
  bo->base.base.format = format;

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

we'll include it in the next upload which will be based on 9.1 branch

tags: added: raring
Revision history for this message
In , Daniel van Vugt (vanvugt) wrote :

Created attachment 74279
gbm_dri_bo_create: Remember to initialize format

Revision history for this message
In , Kristian Hoegsberg (krh-bitplanet) wrote :

(In reply to comment #2)
> Created attachment 74279 [details] [review]
> gbm_dri_bo_create: Remember to initialize format

That looks good, but please also fix create_dumb() and attach output of git format-patch -1 so I can git am it. Thanks!

Revision history for this message
In , Daniel van Vugt (vanvugt) wrote :

Created attachment 74319
[PATCH] gbm: Remember to init format on gbm_dri_bo_create

Revision history for this message
In , Kristian Hoegsberg (krh-bitplanet) wrote :

Pushed to master.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed to upstream Mesa git.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in mesa:
status: Confirmed → Fix Released
Revision history for this message
Iain Lane (laney) wrote :

Unsubscribing sponsors as Timo indicates he is handling this

Changed in mesa (Ubuntu):
assignee: Daniel van Vugt (vanvugt) → nobody
status: In Progress → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The upstream fix appears to have been too late to be included in the Mesa 9.1 release. It's only on Mesa master right now :(

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I've pulled this to the staged package, thanks. It's still possible to include it in upstream stable branches too, we'll see how that goes.

Changed in mesa (Ubuntu Raring):
status: Triaged → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

heh, mlankhorst applied it to both 9.1 and 9.0 branches upstream :)

Changed in mesa (Ubuntu Quantal):
status: New → In Progress
Changed in mesa (Ubuntu Raring):
assignee: nobody → Timo Aaltonen (tjaalton)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I see. As of 30 min ago, the fix landed in both 9.0 and 9.1 branches.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mesa - 9.1.1-0ubuntu2

---------------
mesa (9.1.1-0ubuntu2) raring; urgency=low

  * control, rules: Add llvm-3.2-dev to build-depends for powerpc, enable
    gallium llvm and shared libs (FTBFS).
 -- Timo Aaltonen <email address hidden> Wed, 17 Apr 2013 01:42:38 -0600

Changed in mesa (Ubuntu Raring):
status: In Progress → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".

Changed in mesa (Ubuntu Quantal):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.