From 6ad3516b45f2c458d94b43910f136db56b0f037b Mon Sep 17 00:00:00 2001 From: Gaurav K Singh Date: Thu, 26 Sep 2019 09:03:29 +0530 Subject: [PATCH] CHROMIUM: drm: add debugfs sentinel file to enable TCON firmware updates The current implementation of drm_dp_dpcd_read uses a double read by default, due to issues with certain displays returning garbage data on the first read after resuming from sleep. Updating of TCON firmware requires specific AUX channel sequencing, and the double read breaks this sequence. The drm_dp_dpcd_read function will check the value of this file, and choose either a double or single read based on that value. By default the value is set to FALSE. Setting to TRUE will enable single read functionality. BUG=None TEST=Pick patch, build, boot, verify file exists & is set to FALSE File: /sys/kernel/debug/dri/dpcd_read_once Change-Id: I24993f93f70080f38c69fd0674d7062e821cab85 Signed-off-by: Gaurav K Singh --- drivers/gpu/drm/drm_drv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index b1f90dcef363..8b87675296f2 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -964,6 +964,14 @@ static int drm_stub_open(struct inode *inode, struct file *filp) /* When set to true, allow set/drop master ioctls as normal user */ bool drm_master_relax; +/* + * When set to true, drm_dp_dpcd_read uses a single read. This + * enables updating of the TCON firmware, which requires a + * specific sequence of read/writes, and does not tolerate a + * double read. Value in file is set to false by default. + */ +bool dpcd_read_once; + static const struct file_operations drm_stub_fops = { .owner = THIS_MODULE, .open = drm_stub_open, @@ -1007,6 +1015,12 @@ static int __init drm_core_init(void) "Cannot create /sys/kernel/debug/dri/drm_master_relax\n"); } + if (!debugfs_create_bool("dpcd_read_once", S_IRUSR | S_IWUSR, + drm_debugfs_root, &dpcd_read_once)) { + DRM_ERROR( + "Cannot create /sys/kernel/debug/dri/dpcd_read_once\n"); + } + ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops); if (ret < 0) goto error; -- 1.9.1