diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-10 15:28:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-11-10 15:42:54 +0000 |
commit | 6d7e13f78b63bc21f82056ca6814c54f39adb9e8 (patch) | |
tree | 2ad61575af0daa2b15ba208985fa56de3dd275e7 /src/sna/sna_video_sprite.c | |
parent | f3809df493bfc825fe4068566bb3210e772a6594 (diff) |
sna/video: Add tiling modifiers for addfb2
In case we do end up with a tiled buffer, create the framebuffer
appropriately.
Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video_sprite.c')
-rw-r--r-- | src/sna/sna_video_sprite.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c index a8deabde..c8b77a8e 100644 --- a/src/sna/sna_video_sprite.c +++ b/src/sna/sna_video_sprite.c @@ -282,15 +282,30 @@ sna_video_sprite_show(struct sna *sna, uint32_t handles[4]; uint32_t pitches[4]; /* pitch for each plane */ uint32_t offsets[4]; /* offset of each plane */ + uint64_t modifiers[4]; } f; bool purged = true; memset(&f, 0, sizeof(f)); f.width = frame->width; f.height = frame->height; + f.flags = 1 << 1; /* +modifiers */ f.handles[0] = frame->bo->handle; f.pitches[0] = frame->pitch[0]; + switch (frame->bo->tiling) { + case I915_TILING_NONE: + break; + case I915_TILING_X: + /* I915_FORMAT_MOD_X_TILED */ + f.modifiers[0] = (uint64_t)1 << 56 | 1; + break; + case I915_TILING_Y: + /* I915_FORMAT_MOD_X_TILED */ + f.modifiers[0] = (uint64_t)1 << 56 | 2; + break; + } + switch (frame->id) { case FOURCC_RGB565: f.pixel_format = DRM_FORMAT_RGB565; |