gpu/drm: Create sysfs to expose panel vendor infor
Create sysfs panelId, panelVer, and panelName in /sys/class/drm/card0-DSI-1 and /sys/class/drm/card0-DSI-2 to expose panel_name, panel_id and panel_ver for panel vendor information. Port from: 5df4be294 Change-Id: If6733e1e64ca61c5576e9db0d7aacf62fb5e54a6 Signed-off-by: Bang Nguyen <bangnguyen@motorola.com> Reviewed-on: https://gerrit.mot.com/1444418 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1509785 Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
This commit is contained in:
1 parent
6ae21ba490
commit
b255322a18
3 files changed
+61
-1
No files matched your search
@@ -229,16 +229,64 @@ static ssize_t modes_show(struct device *device,
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t panelId_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
connector->display_info.panel_id);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return 20;
|
||||
}
|
||||
|
||||
static ssize_t panelVer_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
connector->display_info.panel_ver);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return 20;
|
||||
}
|
||||
|
||||
static ssize_t panelName_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "%s\n", connector->display_info.panel_name);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return sizeof(connector->display_info.panel_name);
|
||||
}
|
||||
|
||||
static DEVICE_ATTR_RW(status);
|
||||
static DEVICE_ATTR_RO(enabled);
|
||||
static DEVICE_ATTR_RO(dpms);
|
||||
static DEVICE_ATTR_RO(modes);
|
||||
static DEVICE_ATTR_RO(panelId);
|
||||
static DEVICE_ATTR_RO(panelVer);
|
||||
static DEVICE_ATTR_RO(panelName);
|
||||
|
||||
|
||||
static struct attribute *connector_dev_attrs[] = {
|
||||
&dev_attr_status.attr,
|
||||
&dev_attr_enabled.attr,
|
||||
&dev_attr_dpms.attr,
|
||||
&dev_attr_modes.attr,
|
||||
&dev_attr_panelId.attr,
|
||||
&dev_attr_panelVer.attr,
|
||||
&dev_attr_panelName.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ enum subpixel_order {
|
||||
|
||||
};
|
||||
|
||||
#define DRM_DISPLAY_NAME_LEN 128
|
||||
|
||||
/**
|
||||
* struct drm_scrambling: sink's scrambling support.
|
||||
*/
|
||||
@@ -266,6 +268,11 @@ struct drm_display_info {
|
||||
*/
|
||||
unsigned int height_mm;
|
||||
|
||||
u64 panel_id;
|
||||
u64 panel_ver;
|
||||
char panel_name[DRM_DISPLAY_NAME_LEN];
|
||||
|
||||
|
||||
/**
|
||||
* @pixel_clock: Maximum pixel clock supported by the sink, in units of
|
||||
* 100Hz. This mismatches the clock in &drm_display_mode (which is in
|
||||
|
||||
@@ -146,6 +146,7 @@ enum drm_mode_status {
|
||||
#define CRTC_STEREO_DOUBLE_ONLY (CRTC_STEREO_DOUBLE | CRTC_NO_DBLSCAN | CRTC_NO_VSCAN)
|
||||
|
||||
#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
|
||||
#define DRM_MODE_DISPLAY_NAME_LEN 128
|
||||
|
||||
#define DRM_MODE_MATCH_TIMINGS (1 << 0)
|
||||
#define DRM_MODE_MATCH_CLOCK (1 << 1)
|
||||
@@ -286,6 +287,10 @@ struct drm_display_mode {
|
||||
int vsync_end;
|
||||
int vtotal;
|
||||
int vscan;
|
||||
|
||||
u64 panel_id;
|
||||
u64 panel_ver;
|
||||
char panel_name[DRM_MODE_DISPLAY_NAME_LEN];
|
||||
/**
|
||||
* @flags:
|
||||
*
|
||||
@@ -331,7 +336,7 @@ struct drm_display_mode {
|
||||
int width_mm;
|
||||
|
||||
/**
|
||||
* @height_mm:
|
||||
* @Height_mm:
|
||||
*
|
||||
* Addressable size of the output in mm, projectors should set this to
|
||||
* 0.
|
||||
|
||||
Reference in new issue
Block a user