]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] vivid: fix g_edid implementation
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 27 Mar 2017 08:36:53 +0000 (05:36 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 5 Apr 2017 18:20:57 +0000 (15:20 -0300)
The VIDIOC_G_EDID implementation in vivid didn't take edid->start_block into account when
copying the EDID data.

Make sure that the internal EDID is updated with the correct CEC physical address. Currently
the returned EDID is updated, but that will only work well if edid->start_block is 0.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vivid/vivid-vid-common.c

index 5fc010f6ce67c8bd12e312b2cb14f93eacaad1d5..f0f423c7ca410bb64e034523e13adfd2b806e42f 100644 (file)
@@ -858,7 +858,7 @@ int vidioc_g_edid(struct file *file, void *_fh,
                return -EINVAL;
        if (edid->start_block + edid->blocks > dev->edid_blocks)
                edid->blocks = dev->edid_blocks - edid->start_block;
-       memcpy(edid->edid, dev->edid, edid->blocks * 128);
-       cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
+       cec_set_edid_phys_addr(dev->edid, dev->edid_blocks * 128, adap->phys_addr);
+       memcpy(edid->edid, dev->edid + edid->start_block * 128, edid->blocks * 128);
        return 0;
 }