aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-10-15 13:55:36 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-16 07:32:13 -0400
commitbd9db02ffcf33348f3fb5d33b8623e78d7831d66 (patch)
tree40d0ec1a479e43cf8f6a4d6659cf15bab88c4796 /drivers
parentb94dec877f97d22a27096d0c3d399c1427157aa2 (diff)
drm/i915: Rename i915_pipe_crc_ctl to i915_display_crc_ctl
In the same spirit than: drm/i915: Generalize the CRC command format for future work Let's move from writing 'A plane1' to 'pipe A plane1' to i915_pipe_crc_ctl. This will allow us to extend the interface to transcoders or DDIs in the future. Let's rename the CRC control file to be more generic. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index c609783dd9d3..471c2585e5bc 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1780,7 +1780,7 @@ static const char *pipe_crc_source_name(enum intel_pipe_crc_source source)
1780 return pipe_crc_sources[source]; 1780 return pipe_crc_sources[source];
1781} 1781}
1782 1782
1783static int pipe_crc_ctl_show(struct seq_file *m, void *data) 1783static int display_crc_ctl_show(struct seq_file *m, void *data)
1784{ 1784{
1785 struct drm_device *dev = m->private; 1785 struct drm_device *dev = m->private;
1786 struct drm_i915_private *dev_priv = dev->dev_private; 1786 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1793,11 +1793,11 @@ static int pipe_crc_ctl_show(struct seq_file *m, void *data)
1793 return 0; 1793 return 0;
1794} 1794}
1795 1795
1796static int pipe_crc_ctl_open(struct inode *inode, struct file *file) 1796static int display_crc_ctl_open(struct inode *inode, struct file *file)
1797{ 1797{
1798 struct drm_device *dev = inode->i_private; 1798 struct drm_device *dev = inode->i_private;
1799 1799
1800 return single_open(file, pipe_crc_ctl_show, dev); 1800 return single_open(file, display_crc_ctl_show, dev);
1801} 1801}
1802 1802
1803static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, 1803static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
@@ -1874,7 +1874,7 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
1874 * "pipe A plane1" -> Start CRC computations on plane1 of pipe A 1874 * "pipe A plane1" -> Start CRC computations on plane1 of pipe A
1875 * "pipe A none" -> Stop CRC 1875 * "pipe A none" -> Stop CRC
1876 */ 1876 */
1877static int pipe_crc_ctl_tokenize(char *buf, char *words[], int max_words) 1877static int display_crc_ctl_tokenize(char *buf, char *words[], int max_words)
1878{ 1878{
1879 int n_words = 0; 1879 int n_words = 0;
1880 1880
@@ -1914,20 +1914,20 @@ static const char *pipe_crc_objects[] = {
1914}; 1914};
1915 1915
1916static int 1916static int
1917pipe_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *object) 1917display_crc_ctl_parse_object(const char *buf, enum intel_pipe_crc_object *o)
1918{ 1918{
1919 int i; 1919 int i;
1920 1920
1921 for (i = 0; i < ARRAY_SIZE(pipe_crc_objects); i++) 1921 for (i = 0; i < ARRAY_SIZE(pipe_crc_objects); i++)
1922 if (!strcmp(buf, pipe_crc_objects[i])) { 1922 if (!strcmp(buf, pipe_crc_objects[i])) {
1923 *object = i; 1923 *o = i;
1924 return 0; 1924 return 0;
1925 } 1925 }
1926 1926
1927 return -EINVAL; 1927 return -EINVAL;
1928} 1928}
1929 1929
1930static int pipe_crc_ctl_parse_pipe(const char *buf, enum pipe *pipe) 1930static int display_crc_ctl_parse_pipe(const char *buf, enum pipe *pipe)
1931{ 1931{
1932 const char name = buf[0]; 1932 const char name = buf[0];
1933 1933
@@ -1940,20 +1940,20 @@ static int pipe_crc_ctl_parse_pipe(const char *buf, enum pipe *pipe)
1940} 1940}
1941 1941
1942static int 1942static int
1943pipe_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *source) 1943display_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *s)
1944{ 1944{
1945 int i; 1945 int i;
1946 1946
1947 for (i = 0; i < ARRAY_SIZE(pipe_crc_sources); i++) 1947 for (i = 0; i < ARRAY_SIZE(pipe_crc_sources); i++)
1948 if (!strcmp(buf, pipe_crc_sources[i])) { 1948 if (!strcmp(buf, pipe_crc_sources[i])) {
1949 *source = i; 1949 *s = i;
1950 return 0; 1950 return 0;
1951 } 1951 }
1952 1952
1953 return -EINVAL; 1953 return -EINVAL;
1954} 1954}
1955 1955
1956static int pipe_crc_ctl_parse(struct drm_device *dev, char *buf, size_t len) 1956static int display_crc_ctl_parse(struct drm_device *dev, char *buf, size_t len)
1957{ 1957{
1958#define N_WORDS 3 1958#define N_WORDS 3
1959 int n_words; 1959 int n_words;
@@ -1962,24 +1962,24 @@ static int pipe_crc_ctl_parse(struct drm_device *dev, char *buf, size_t len)
1962 enum intel_pipe_crc_object object; 1962 enum intel_pipe_crc_object object;
1963 enum intel_pipe_crc_source source; 1963 enum intel_pipe_crc_source source;
1964 1964
1965 n_words = pipe_crc_ctl_tokenize(buf, words, N_WORDS); 1965 n_words = display_crc_ctl_tokenize(buf, words, N_WORDS);
1966 if (n_words != N_WORDS) { 1966 if (n_words != N_WORDS) {
1967 DRM_DEBUG_DRIVER("tokenize failed, a command is %d words\n", 1967 DRM_DEBUG_DRIVER("tokenize failed, a command is %d words\n",
1968 N_WORDS); 1968 N_WORDS);
1969 return -EINVAL; 1969 return -EINVAL;
1970 } 1970 }
1971 1971
1972 if (pipe_crc_ctl_parse_object(words[0], &object) < 0) { 1972 if (display_crc_ctl_parse_object(words[0], &object) < 0) {
1973 DRM_DEBUG_DRIVER("unknown object %s\n", words[0]); 1973 DRM_DEBUG_DRIVER("unknown object %s\n", words[0]);
1974 return -EINVAL; 1974 return -EINVAL;
1975 } 1975 }
1976 1976
1977 if (pipe_crc_ctl_parse_pipe(words[1], &pipe) < 0) { 1977 if (display_crc_ctl_parse_pipe(words[1], &pipe) < 0) {
1978 DRM_DEBUG_DRIVER("unknown pipe %s\n", words[1]); 1978 DRM_DEBUG_DRIVER("unknown pipe %s\n", words[1]);
1979 return -EINVAL; 1979 return -EINVAL;
1980 } 1980 }
1981 1981
1982 if (pipe_crc_ctl_parse_source(words[2], &source) < 0) { 1982 if (display_crc_ctl_parse_source(words[2], &source) < 0) {
1983 DRM_DEBUG_DRIVER("unknown source %s\n", words[2]); 1983 DRM_DEBUG_DRIVER("unknown source %s\n", words[2]);
1984 return -EINVAL; 1984 return -EINVAL;
1985 } 1985 }
@@ -1987,8 +1987,8 @@ static int pipe_crc_ctl_parse(struct drm_device *dev, char *buf, size_t len)
1987 return pipe_crc_set_source(dev, pipe, source); 1987 return pipe_crc_set_source(dev, pipe, source);
1988} 1988}
1989 1989
1990static ssize_t pipe_crc_ctl_write(struct file *file, const char __user *ubuf, 1990static ssize_t display_crc_ctl_write(struct file *file, const char __user *ubuf,
1991 size_t len, loff_t *offp) 1991 size_t len, loff_t *offp)
1992{ 1992{
1993 struct seq_file *m = file->private_data; 1993 struct seq_file *m = file->private_data;
1994 struct drm_device *dev = m->private; 1994 struct drm_device *dev = m->private;
@@ -2014,7 +2014,7 @@ static ssize_t pipe_crc_ctl_write(struct file *file, const char __user *ubuf,
2014 } 2014 }
2015 tmpbuf[len] = '\0'; 2015 tmpbuf[len] = '\0';
2016 2016
2017 ret = pipe_crc_ctl_parse(dev, tmpbuf, len); 2017 ret = display_crc_ctl_parse(dev, tmpbuf, len);
2018 2018
2019out: 2019out:
2020 kfree(tmpbuf); 2020 kfree(tmpbuf);
@@ -2025,13 +2025,13 @@ out:
2025 return len; 2025 return len;
2026} 2026}
2027 2027
2028static const struct file_operations i915_pipe_crc_ctl_fops = { 2028static const struct file_operations i915_display_crc_ctl_fops = {
2029 .owner = THIS_MODULE, 2029 .owner = THIS_MODULE,
2030 .open = pipe_crc_ctl_open, 2030 .open = display_crc_ctl_open,
2031 .read = seq_read, 2031 .read = seq_read,
2032 .llseek = seq_lseek, 2032 .llseek = seq_lseek,
2033 .release = single_release, 2033 .release = single_release,
2034 .write = pipe_crc_ctl_write 2034 .write = display_crc_ctl_write
2035}; 2035};
2036 2036
2037static int 2037static int
@@ -2569,7 +2569,7 @@ static struct i915_debugfs_files {
2569 {"i915_gem_drop_caches", &i915_drop_caches_fops}, 2569 {"i915_gem_drop_caches", &i915_drop_caches_fops},
2570 {"i915_error_state", &i915_error_state_fops}, 2570 {"i915_error_state", &i915_error_state_fops},
2571 {"i915_next_seqno", &i915_next_seqno_fops}, 2571 {"i915_next_seqno", &i915_next_seqno_fops},
2572 {"i915_pipe_crc_ctl", &i915_pipe_crc_ctl_fops}, 2572 {"i915_display_crc_ctl", &i915_display_crc_ctl_fops},
2573}; 2573};
2574 2574
2575int i915_debugfs_init(struct drm_minor *minor) 2575int i915_debugfs_init(struct drm_minor *minor)