mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 20:48:08 +02:00
renderonly: fix dumb BO allocation for non 32bpp formats
Take into account the resource format, instead of applying a hardcoded 32bpp. This not only over-allocates 16bpp formats, but also results in a wrong stride being filled into the handle. Fixes:848b49b288("gallium: add renderonly library") CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Daniel Stone <daniels@collabora.com> (cherry picked from commit0c71a19fe4)
This commit is contained in:
parent
6a7e3a152e
commit
ac087eb40d
1 changed files with 2 additions and 1 deletions
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "state_tracker/drm_driver.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/u_format.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
|
|||
struct drm_mode_create_dumb create_dumb = {
|
||||
.width = rsc->width0,
|
||||
.height = rsc->height0,
|
||||
.bpp = 32,
|
||||
.bpp = util_format_get_blocksizebits(rsc->format),
|
||||
};
|
||||
struct drm_mode_destroy_dumb destroy_dumb = { };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue