* [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
@ 2011-09-21 22:49 ` Michael Witten
2011-09-21 22:50 ` [PATCH 2/7] DRM: comment: halve -> half Michael Witten
` (6 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:49 UTC (permalink / raw)
To: dri-devel
Date: Thu, 15 Sep 2011 21:06:24 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index f88a9b2..8ec3447 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -303,19 +303,19 @@ drm_crtc_prepare_encoders(struct drm_device *dev)
}
/**
- * drm_crtc_set_mode - set a mode
+ * drm_crtc_helper_set_mode - set a mode
* @crtc: CRTC to program
* @mode: mode to use
* @x: width of mode
* @y: height of mode
*
* LOCKING:
* Caller must hold mode config lock.
*
* Try to set @mode on @crtc. Give @crtc and its associated connectors a chance
* to fixup or reject the mode prior to trying to set it.
*
* RETURNS:
* True if the mode was set successfully, or false otherwise.
*/
bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/7] DRM: comment: halve -> half
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-09-21 22:49 ` [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-21 22:50 ` [PATCH 3/7] DRM: cleanup: Remove unused `gamma_size' Michael Witten
` (5 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Thu, 15 Sep 2011 21:07:26 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/drm_irq.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 3830e9e..61cb85d 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -493,8 +493,8 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc)
/* Dot clock in Hz: */
dotclock = (u64) crtc->hwmode.clock * 1000;
- /* Fields of interlaced scanout modes are only halve a frame duration.
- * Double the dotclock to get halve the frame-/line-/pixelduration.
+ /* Fields of interlaced scanout modes are only half a frame duration.
+ * Double the dotclock to get half the frame-/line-/pixelduration.
*/
if (crtc->hwmode.flags & DRM_MODE_FLAG_INTERLACE)
dotclock *= 2;
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/7] DRM: cleanup: Remove unused `gamma_size'
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-09-21 22:49 ` [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode Michael Witten
2011-09-21 22:50 ` [PATCH 2/7] DRM: comment: halve -> half Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-21 22:50 ` [PATCH 6/7] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
` (4 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Thu, 15 Sep 2011 21:12:19 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/drm_fb_helper.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index f7c6854..9a9107a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -760,7 +760,6 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
int i;
struct fb_info *info;
struct drm_fb_helper_surface_size sizes;
- int gamma_size = 0;
memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size));
sizes.surface_depth = 24;
@@ -810,8 +809,6 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
desired_mode = fb_helper->crtc_info[i].desired_mode;
if (desired_mode) {
- if (gamma_size == 0)
- gamma_size = fb_helper->crtc_info[i].mode_set.crtc->gamma_size;
if (desired_mode->hdisplay < sizes.fb_width)
sizes.fb_width = desired_mode->hdisplay;
if (desired_mode->vdisplay < sizes.fb_height)
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/7] DRM: comment: gdm_proc_lists -> drm_proc_lists
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
` (4 preceding siblings ...)
2011-09-21 22:50 ` [PATCH 5/7] DRM: cleanup: `size == 0' is never true Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
2011-09-26 20:47 ` [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Thu, 15 Sep 2011 14:43:00 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/drm_proc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index 9e5b07e..13df242 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -87,7 +87,7 @@ static const struct file_operations drm_proc_fops = {
* \return Zero on success, non-zero on failure
*
* Create a given set of proc files represented by an array of
- * gdm_proc_lists in the given root directory.
+ * drm_proc_lists in the given root directory.
*/
int drm_proc_create_files(struct drm_info_list *files, int count,
struct proc_dir_entry *root, struct drm_minor *minor)
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/7] DRM: cleanup: `size == 0' is never true
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
` (3 preceding siblings ...)
2011-09-21 22:50 ` [PATCH 6/7] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-21 22:50 ` [PATCH 4/7] DRM: comment: gdm_proc_lists -> drm_proc_lists Michael Witten
` (2 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Fri, 16 Sep 2011 20:09:22 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/radeon/radeon_bios.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 229a20f..af62082 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -59,7 +59,7 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
return false;
}
- if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
+ if (bios[0] != 0x55 || bios[1] != 0xaa) {
iounmap(bios);
return false;
}
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/7] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
` (2 preceding siblings ...)
2011-09-21 22:50 ` [PATCH 3/7] DRM: cleanup: Remove unused `gamma_size' Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-21 22:50 ` [PATCH 5/7] DRM: cleanup: `size == 0' is never true Michael Witten
` (3 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Fri, 16 Sep 2011 20:45:30 +0000
The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
specify the size of an array, each element of which looks
like this:
struct radeon_debugfs {
struct drm_info_list *files;
unsigned num_files;
};
Consequently, the number of debugfs files may be much greater
than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
code ignores:
if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
DRM_ERROR("Reached maximum number of debugfs files.\n");
DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
return -EINVAL;
}
This commit fixes this make, and accordingly renames:
RADEON_DEBUGFS_MAX_NUM_FILES
to:
RADEON_DEBUGFS_MAX_COMPONENTS
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/radeon/radeon.h | 2 +-
drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c1e056b..dd7bab9 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -102,7 +102,7 @@ extern int radeon_pcie_gen2;
#define RADEON_FENCE_JIFFIES_TIMEOUT (HZ / 2)
/* RADEON_IB_POOL_SIZE must be a power of 2 */
#define RADEON_IB_POOL_SIZE 16
-#define RADEON_DEBUGFS_MAX_NUM_FILES 32
+#define RADEON_DEBUGFS_MAX_COMPONENTS 32
#define RADEONFB_CONN_LIMIT 4
#define RADEON_BIOS_NUM_SCRATCH 8
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index b51e157..31b1f4b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -981,7 +981,7 @@ struct radeon_debugfs {
struct drm_info_list *files;
unsigned num_files;
};
-static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES];
+static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
static unsigned _radeon_debugfs_count = 0;
int radeon_debugfs_add_files(struct radeon_device *rdev,
@@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
return 0;
}
}
- if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
- DRM_ERROR("Reached maximum number of debugfs files.\n");
- DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
+
+ i = _radeon_debugfs_count + 1;
+ if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
+ DRM_ERROR("Reached maximum number of debugfs components.\n");
+ DRM_ERROR("Report so we increase "
+ "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
return -EINVAL;
}
_radeon_debugfs[_radeon_debugfs_count].files = files;
_radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
- _radeon_debugfs_count++;
+ _radeon_debugfs_count = i;
#if defined(CONFIG_DEBUG_FS)
drm_debugfs_create_files(files, nfiles,
rdev->ddev->control->debugfs_root,
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/7] DRM: cleanup: Remove unsused `tmp'
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
` (5 preceding siblings ...)
2011-09-21 22:50 ` [PATCH 4/7] DRM: comment: gdm_proc_lists -> drm_proc_lists Michael Witten
@ 2011-09-21 22:50 ` Michael Witten
2011-09-22 9:24 ` Michel Dänzer
2015-04-14 13:44 ` [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()' Michael Witten
2011-09-26 20:47 ` [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
7 siblings, 2 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Date: Wed, 21 Sep 2011 02:10:43 +0000
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 6367524..b0549aa 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1227,7 +1227,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
uint16_t lcd_info;
uint32_t panel_setup;
char stmp[30];
- int tmp, i;
+ int i;
struct radeon_encoder_lvds *lvds = NULL;
lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE);
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 0/7] DRM/Radeon Cleanup
@ 2011-09-21 22:50 Michael Witten
2011-09-21 22:49 ` [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode Michael Witten
` (7 more replies)
0 siblings, 8 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-21 22:50 UTC (permalink / raw)
To: dri-devel
Whilst working on my failing Radeon GPU:
Subject: Re: Curious experiences with a Radeon on the fritz
Date: Wed, 21 Sep 2011 18:52:19 -0000
Message-ID: <c0efd8527ff34853a23f1d706be29c67-mfwitten@gmail.com>
http://lists.freedesktop.org/archives/dri-devel/2011-September/014506.html
I made the following trivial improvements to the DRM/Radeon code
along the way ([6] fixes a bug):
[1] DRM: comment: drm_crtc{=>_helper}_set_mode
[2] DRM: comment: halve -> half
[3] DRM: cleanup: Remove unused `gamma_size'
[4] DRM: comment: gdm_proc_lists -> drm_proc_lists
[5] DRM: cleanup: `size == 0' is never true
[6] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
[7] DRM: cleanup: Remove unsused `tmp'
Here is the overall difference:
drivers/gpu/drm/drm_crtc_helper.c | 2 +-
drivers/gpu/drm/drm_fb_helper.c | 3 ---
drivers/gpu/drm/drm_irq.c | 4 ++--
drivers/gpu/drm/drm_proc.c | 2 +-
drivers/gpu/drm/radeon/radeon.h | 2 +-
drivers/gpu/drm/radeon/radeon_bios.c | 2 +-
drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
8 files changed, 15 insertions(+), 15 deletions(-)
Sincerely,
Michael Witten
--
1.7.6.409.ge7a85
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 7/7] DRM: cleanup: Remove unsused `tmp'
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
@ 2011-09-22 9:24 ` Michel Dänzer
2011-09-22 17:16 ` Michael Witten
2015-04-14 13:44 ` [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()' Michael Witten
1 sibling, 1 reply; 17+ messages in thread
From: Michel Dänzer @ 2011-09-22 9:24 UTC (permalink / raw)
To: Michael Witten; +Cc: dri-devel
On Mit, 2011-09-21 at 22:50 +0000, Michael Witten wrote:
> Date: Wed, 21 Sep 2011 02:10:43 +0000
>
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
> index 6367524..b0549aa 100644
> --- a/drivers/gpu/drm/radeon/radeon_combios.c
> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
> @@ -1227,7 +1227,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
> uint16_t lcd_info;
> uint32_t panel_setup;
> char stmp[30];
> - int tmp, i;
> + int i;
> struct radeon_encoder_lvds *lvds = NULL;
>
> lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE);
It's not unused here. Maybe it is for you because you disabled reading
some values from the VBIOS?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 7/7] DRM: cleanup: Remove unsused `tmp'
2011-09-22 9:24 ` Michel Dänzer
@ 2011-09-22 17:16 ` Michael Witten
0 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-09-22 17:16 UTC (permalink / raw)
To: Michel Dänzer; +Cc: dri-devel
2011/9/22 Michel Dänzer <michel@daenzer.net>:
> On Mit, 2011-09-21 at 22:50 +0000, Michael Witten wrote:
>> Date: Wed, 21 Sep 2011 02:10:43 +0000
>>
>> Signed-off-by: Michael Witten <mfwitten@gmail.com>
>> ---
>> drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
>> index 6367524..b0549aa 100644
>> --- a/drivers/gpu/drm/radeon/radeon_combios.c
>> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
>> @@ -1227,7 +1227,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
>> uint16_t lcd_info;
>> uint32_t panel_setup;
>> char stmp[30];
>> - int tmp, i;
>> + int i;
>> struct radeon_encoder_lvds *lvds = NULL;
>>
>> lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE);
>
> It's not unused here. Maybe it is for you because you disabled reading
> some values from the VBIOS?
Woops! :-P
You are correct.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/7] DRM/Radeon Cleanup
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
` (6 preceding siblings ...)
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
@ 2011-09-26 20:47 ` Michael Witten
2011-10-07 19:20 ` [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
7 siblings, 1 reply; 17+ messages in thread
From: Michael Witten @ 2011-09-26 20:47 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel
On Wed, 21 Sep 2011 22:50:57 -0000, Michael Witten wrote:
> Whilst working on my failing Radeon GPU:
>
> Subject: Re: Curious experiences with a Radeon on the fritz
> Date: Wed, 21 Sep 2011 18:52:19 -0000
> Message-ID: <c0efd8527ff34853a23f1d706be29c67-mfwitten@gmail.com>
> http://lists.freedesktop.org/archives/dri-devel/2011-September/014506.html
>
> I made the following trivial improvements to the DRM/Radeon code
> along the way ([6] fixes a bug):
>
> [1] DRM: comment: drm_crtc{=>_helper}_set_mode
> [2] DRM: comment: halve -> half
> [3] DRM: cleanup: Remove unused `gamma_size'
> [4] DRM: comment: gdm_proc_lists -> drm_proc_lists
> [5] DRM: cleanup: `size == 0' is never true
> [6] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
> [7] DRM: cleanup: Remove unsused `tmp'
>
> Here is the overall difference:
>
> drivers/gpu/drm/drm_crtc_helper.c | 2 +-
> drivers/gpu/drm/drm_fb_helper.c | 3 ---
> drivers/gpu/drm/drm_irq.c | 4 ++--
> drivers/gpu/drm/drm_proc.c | 2 +-
> drivers/gpu/drm/radeon/radeon.h | 2 +-
> drivers/gpu/drm/radeon/radeon_bios.c | 2 +-
> drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
> drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
> 8 files changed, 15 insertions(+), 15 deletions(-)
When you get the chance, David, please apply all but [4] and [7].
* Patch [4] is not really helpful, because it poorly changes a
comment in what is deprecated, probably erroneous code anyway.
* [7] was a mistake on my part.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
2011-09-26 20:47 ` [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
@ 2011-10-07 19:20 ` Michael Witten
2011-10-24 23:21 ` Michael Witten
0 siblings, 1 reply; 17+ messages in thread
From: Michael Witten @ 2011-10-07 19:20 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel
Date: Fri, 16 Sep 2011 20:45:30 +0000
The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
specify the size of an array, each element of which looks
like this:
struct radeon_debugfs {
struct drm_info_list *files;
unsigned num_files;
};
Consequently, the number of debugfs files may be much greater
than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
code ignores:
if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
DRM_ERROR("Reached maximum number of debugfs files.\n");
DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
return -EINVAL;
}
This commit fixes this mistake, and accordingly renames:
RADEON_DEBUGFS_MAX_NUM_FILES
to:
RADEON_DEBUGFS_MAX_COMPONENTS
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/radeon/radeon.h | 2 +-
drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c1e056b..dd7bab9 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -102,7 +102,7 @@ extern int radeon_pcie_gen2;
#define RADEON_FENCE_JIFFIES_TIMEOUT (HZ / 2)
/* RADEON_IB_POOL_SIZE must be a power of 2 */
#define RADEON_IB_POOL_SIZE 16
-#define RADEON_DEBUGFS_MAX_NUM_FILES 32
+#define RADEON_DEBUGFS_MAX_COMPONENTS 32
#define RADEONFB_CONN_LIMIT 4
#define RADEON_BIOS_NUM_SCRATCH 8
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index b51e157..31b1f4b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -981,7 +981,7 @@ struct radeon_debugfs {
struct drm_info_list *files;
unsigned num_files;
};
-static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES];
+static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
static unsigned _radeon_debugfs_count = 0;
int radeon_debugfs_add_files(struct radeon_device *rdev,
@@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
return 0;
}
}
- if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
- DRM_ERROR("Reached maximum number of debugfs files.\n");
- DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
+
+ i = _radeon_debugfs_count + 1;
+ if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
+ DRM_ERROR("Reached maximum number of debugfs components.\n");
+ DRM_ERROR("Report so we increase "
+ "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
return -EINVAL;
}
_radeon_debugfs[_radeon_debugfs_count].files = files;
_radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
- _radeon_debugfs_count++;
+ _radeon_debugfs_count = i;
#if defined(CONFIG_DEBUG_FS)
drm_debugfs_create_files(files, nfiles,
rdev->ddev->control->debugfs_root,
--
1.7.6.409.ge7a85
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
2011-10-07 19:20 ` [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
@ 2011-10-24 23:21 ` Michael Witten
2011-10-25 1:35 ` Ilija Hadzic
0 siblings, 1 reply; 17+ messages in thread
From: Michael Witten @ 2011-10-24 23:21 UTC (permalink / raw)
To: David Airlie; +Cc: dri-devel
On Fri, Oct 7, 2011 at 19:20, Michael Witten <mfwitten@gmail.com> wrote:
> Date: Fri, 16 Sep 2011 20:45:30 +0000
>
> The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
> specify the size of an array, each element of which looks
> like this:
>
> struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
>
> Consequently, the number of debugfs files may be much greater
> than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
> code ignores:
>
> if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> DRM_ERROR("Reached maximum number of debugfs files.\n");
> DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> return -EINVAL;
> }
>
> This commit fixes this mistake, and accordingly renames:
>
> RADEON_DEBUGFS_MAX_NUM_FILES
>
> to:
>
> RADEON_DEBUGFS_MAX_COMPONENTS
>
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon.h | 2 +-
> drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index c1e056b..dd7bab9 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -102,7 +102,7 @@ extern int radeon_pcie_gen2;
> #define RADEON_FENCE_JIFFIES_TIMEOUT (HZ / 2)
> /* RADEON_IB_POOL_SIZE must be a power of 2 */
> #define RADEON_IB_POOL_SIZE 16
> -#define RADEON_DEBUGFS_MAX_NUM_FILES 32
> +#define RADEON_DEBUGFS_MAX_COMPONENTS 32
> #define RADEONFB_CONN_LIMIT 4
> #define RADEON_BIOS_NUM_SCRATCH 8
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index b51e157..31b1f4b 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -981,7 +981,7 @@ struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
> -static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES];
> +static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
> static unsigned _radeon_debugfs_count = 0;
>
> int radeon_debugfs_add_files(struct radeon_device *rdev,
> @@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
> return 0;
> }
> }
> - if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> - DRM_ERROR("Reached maximum number of debugfs files.\n");
> - DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> +
> + i = _radeon_debugfs_count + 1;
> + if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
> + DRM_ERROR("Reached maximum number of debugfs components.\n");
> + DRM_ERROR("Report so we increase "
> + "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
> return -EINVAL;
> }
> _radeon_debugfs[_radeon_debugfs_count].files = files;
> _radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
> - _radeon_debugfs_count++;
> + _radeon_debugfs_count = i;
> #if defined(CONFIG_DEBUG_FS)
> drm_debugfs_create_files(files, nfiles,
> rdev->ddev->control->debugfs_root,
> --
> 1.7.6.409.ge7a85
>
>
This patch has not yet been applied. What's wrong?
Sincerely,
Michael Witten
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
2011-10-24 23:21 ` Michael Witten
@ 2011-10-25 1:35 ` Ilija Hadzic
2011-10-26 15:07 ` Michael Witten
0 siblings, 1 reply; 17+ messages in thread
From: Ilija Hadzic @ 2011-10-25 1:35 UTC (permalink / raw)
To: Michael Witten; +Cc: dri-devel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 4270 bytes --]
Maybe you are looking at the wrong branch, but I see it in drm-next (it
has been there since Oct 10)
http://cgit.freedesktop.org/~airlied/linux/commit/?h=drm-next&id=c245cb9e15055ed5dcf7eaf29232badb0059fdc1
On Mon, 24 Oct 2011, Michael Witten wrote:
> On Fri, Oct 7, 2011 at 19:20, Michael Witten <mfwitten@gmail.com> wrote:
> Date: Fri, 16 Sep 2011 20:45:30 +0000
>
> The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
> specify the size of an array, each element of which looks
> like this:
>
> struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
>
> Consequently, the number of debugfs files may be much greater
> than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
> code ignores:
>
> if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> DRM_ERROR("Reached maximum number of debugfs files.\n");
> DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> return -EINVAL;
> }
>
> This commit fixes this mistake, and accordingly renames:
>
> RADEON_DEBUGFS_MAX_NUM_FILES
>
> to:
>
> RADEON_DEBUGFS_MAX_COMPONENTS
>
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon.h | 2 +-
> drivers/gpu/drm/radeon/radeon_device.c | 13 ++++++++-----
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index c1e056b..dd7bab9 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -102,7 +102,7 @@ extern int radeon_pcie_gen2;
> #define RADEON_FENCE_JIFFIES_TIMEOUT (HZ / 2)
> /* RADEON_IB_POOL_SIZE must be a power of 2 */
> #define RADEON_IB_POOL_SIZE 16
> -#define RADEON_DEBUGFS_MAX_NUM_FILES 32
> +#define RADEON_DEBUGFS_MAX_COMPONENTS 32
> #define RADEONFB_CONN_LIMIT 4
> #define RADEON_BIOS_NUM_SCRATCH 8
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index b51e157..31b1f4b 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -981,7 +981,7 @@ struct radeon_debugfs {
> struct drm_info_list *files;
> unsigned num_files;
> };
> -static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_NUM_FILES];
> +static struct radeon_debugfs _radeon_debugfs[RADEON_DEBUGFS_MAX_COMPONENTS];
> static unsigned _radeon_debugfs_count = 0;
>
> int radeon_debugfs_add_files(struct radeon_device *rdev,
> @@ -996,14 +996,17 @@ int radeon_debugfs_add_files(struct radeon_device *rdev,
> return 0;
> }
> }
> - if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
> - DRM_ERROR("Reached maximum number of debugfs files.\n");
> - DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
> +
> + i = _radeon_debugfs_count + 1;
> + if (i > RADEON_DEBUGFS_MAX_COMPONENTS) {
> + DRM_ERROR("Reached maximum number of debugfs components.\n");
> + DRM_ERROR("Report so we increase "
> + "RADEON_DEBUGFS_MAX_COMPONENTS.\n");
> return -EINVAL;
> }
> _radeon_debugfs[_radeon_debugfs_count].files = files;
> _radeon_debugfs[_radeon_debugfs_count].num_files = nfiles;
> - _radeon_debugfs_count++;
> + _radeon_debugfs_count = i;
> #if defined(CONFIG_DEBUG_FS)
> drm_debugfs_create_files(files, nfiles,
> rdev->ddev->control->debugfs_root,
> --
> 1.7.6.409.ge7a85
>
>
This patch has not yet been applied. What's wrong?
Sincerely,
Michael Witten
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
2011-10-25 1:35 ` Ilija Hadzic
@ 2011-10-26 15:07 ` Michael Witten
0 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2011-10-26 15:07 UTC (permalink / raw)
To: Ilija Hadzic; +Cc: dri-devel
On Tue, Oct 25, 2011 at 01:35, Ilija Hadzic
<ihadzic@research.bell-labs.com> wrote:
> On Mon, 24 Oct 2011, Michael Witten wrote:
>
>> This patch has not yet been applied. What's wrong?
>
> Maybe you are looking at the wrong branch, but I see it in drm-next (it has
> been there since Oct 10)
>
> http://cgit.freedesktop.org/~airlied/linux/commit/?h=drm-next&id=c245cb9e15055ed5dcf7eaf29232badb0059fdc1
Well! I feel silly!
Thanks.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()'
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
2011-09-22 9:24 ` Michel Dänzer
@ 2015-04-14 13:44 ` Michael Witten
2015-04-14 15:54 ` Michael Witten
1 sibling, 1 reply; 17+ messages in thread
From: Michael Witten @ 2015-04-14 13:44 UTC (permalink / raw)
To: Jiri Kosina; +Cc: dri-devel
Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 0b3c1e0..7962091 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -1175,7 +1175,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
uint16_t lcd_info;
uint32_t panel_setup;
char stmp[30];
- int tmp, i;
+ int i;
struct radeon_encoder_lvds *lvds = NULL;
lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE);
--
1.7.11.2.252.gc4a64c8
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()'
2015-04-14 13:44 ` [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()' Michael Witten
@ 2015-04-14 15:54 ` Michael Witten
0 siblings, 0 replies; 17+ messages in thread
From: Michael Witten @ 2015-04-14 15:54 UTC (permalink / raw)
To: Jiri Kosina; +Cc: dri-devel
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon_combios.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
> index 0b3c1e0..7962091 100644
> --- a/drivers/gpu/drm/radeon/radeon_combios.c
> +++ b/drivers/gpu/drm/radeon/radeon_combios.c
> @@ -1175,7 +1175,7 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
> uint16_t lcd_info;
> uint32_t panel_setup;
> char stmp[30];
> - int tmp, i;
> + int i;
> struct radeon_encoder_lvds *lvds = NULL;
>
> lcd_info = combios_get_table_offset(dev, COMBIOS_LCD_INFO_TABLE);
> --
> 1.7.11.2.252.gc4a64c8
PLEASE IGNORE THIS!
I made the same mistake that I did 3.5 years ago; the variable `tmp' is NOT unused:
http://article.gmane.org/gmane.comp.video.dri.devel/60785
Sorry for the irritation.
Sincerely,
Michael Witten
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2015-04-14 15:58 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 22:50 [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-09-21 22:49 ` [PATCH 1/7] DRM: comment: drm_crtc{=>_helper}_set_mode Michael Witten
2011-09-21 22:50 ` [PATCH 2/7] DRM: comment: halve -> half Michael Witten
2011-09-21 22:50 ` [PATCH 3/7] DRM: cleanup: Remove unused `gamma_size' Michael Witten
2011-09-21 22:50 ` [PATCH 6/7] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
2011-09-21 22:50 ` [PATCH 5/7] DRM: cleanup: `size == 0' is never true Michael Witten
2011-09-21 22:50 ` [PATCH 4/7] DRM: comment: gdm_proc_lists -> drm_proc_lists Michael Witten
2011-09-21 22:50 ` [PATCH 7/7] DRM: cleanup: Remove unsused `tmp' Michael Witten
2011-09-22 9:24 ` Michel Dänzer
2011-09-22 17:16 ` Michael Witten
2015-04-14 13:44 ` [PATCH] trivial: Remove unused variable `tmp' from `radeon_combios_get_lvds_info()' Michael Witten
2015-04-14 15:54 ` Michael Witten
2011-09-26 20:47 ` [PATCH 0/7] DRM/Radeon Cleanup Michael Witten
2011-10-07 19:20 ` [PATCH] DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS} Michael Witten
2011-10-24 23:21 ` Michael Witten
2011-10-25 1:35 ` Ilija Hadzic
2011-10-26 15:07 ` Michael Witten
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.