OSDN Git Service

Remove level=stride hack in virtio_gpu_bo_invalidate
authorWoody Chow <woodychow@google.com>
Fri, 17 Jan 2020 07:46:33 +0000 (16:46 +0900)
committerCommit Bot <commit-bot@chromium.org>
Thu, 23 Jan 2020 14:06:51 +0000 (14:06 +0000)
The non-gbm path in virglrenderer does not need this hack

BUG=b:142364535
TEST=Run these CTS tests
android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputCpuRead_R8G8B8A8_UNORM
android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputCpuRead_R8G8B8X8_UNORM
android.hardware.nativehardware.cts.AHardwareBufferNativeTests#SingleLayer_ColorTest_GpuColorOutputCpuRead_R5G6B5_UNORM

Change-Id: I672dcec7e3bb5d9e6841e6ea48f56f26a4130df2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2007028
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Woody Chow <woodychow@chromium.org>
Commit-Queue: Woody Chow <woodychow@chromium.org>

virtio_gpu.c

index 50ca997..1eeba26 100644 (file)
@@ -292,10 +292,8 @@ static int virtio_gpu_bo_invalidate(struct bo *bo, struct mapping *mapping)
        xfer.box.h = mapping->rect.height;
        xfer.box.d = 1;
 
-       // Unfortunately, the kernel doesn't actually pass the guest layer_stride and
-       // guest stride to the host (compare virtio_gpu.h and virtgpu_drm.h). We can use
-       // the level to work around this.
-       xfer.level = bo->meta.strides[0];
+       // TODO(b/145993887): Send also stride when the patches are landed
+       // When BO_USE_RENDERING is set, the level=stride hack is not needed
 
        ret = drmIoctl(bo->drv->fd, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &xfer);
        if (ret) {