Push the ifdef to the drm_edid.h and create a stub, for the DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in the code, making it more readable.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar --- drivers/gpu/drm/drm_probe_helper.c | 2 -- include/drm/drm_edid.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index e714b5a7955f..0329080d7f7c 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, count = drm_add_edid_modes(connector, edid); drm_edid_to_eld(connector, edid); } else { -#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE count = drm_load_edid_firmware(connector); if (count == 0) -#endif count = (*connector_funcs->get_modes)(connector); }
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af97691e878..5996598bc778 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); struct drm_connector *drm_select_eld(struct drm_encoder *encoder); + +#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE int drm_load_edid_firmware(struct drm_connector *connector); +#else +static inline int drm_load_edid_firmware(struct drm_connector *connector) +{ + return 0; +} +#endif
int drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
Let's be user-friendly and print an actually helpful parameter description.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar --- drivers/gpu/drm/drm_drv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..49b658069b51 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,15 +37,24 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/* + * drm_debug: Enable debug output. + * Bitmask of DRM_UT_x. See include/drm/drmP.h for details. + */ +unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enables debug output, where each bit enables a debug category.\n" +"Bit 0 (0x1) will enable CORE messages (drm core code)\n" +"Bit 1 (0x2) will enable DRIVER messages (drm controller code)\n" +"Bit 2 (0x4) will enable KMS messages (modesetting code)\n" +"Bit 3 (0x8) will enable PRMIE messages (prime code)\n"); module_param_named(debug, drm_debug, int, 0600);
+ static DEFINE_SPINLOCK(drm_minor_lock); static struct idr drm_minors_idr;
On 19 April 2016 at 18:40, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Let's be user-friendly and print an actually helpful parameter description.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
drivers/gpu/drm/drm_drv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..49b658069b51 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,15 +37,24 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/*
- drm_debug: Enable debug output.
- Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
- */
+unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enables debug output, where each bit enables a debug category.\n" +"Bit 0 (0x1) will enable CORE messages (drm core code)\n" +"Bit 1 (0x2) will enable DRIVER messages (drm controller code)\n" +"Bit 2 (0x4) will enable KMS messages (modesetting code)\n" +"Bit 3 (0x8) will enable PRMIE messages (prime code)\n");
typo "PRIME"
If you're doing to document things please mention all the options - you've missed the following two. #define DRM_UT_ATOMIC 0x10 #define DRM_UT_VBL 0x20
Thanks Emil
On Tue, 19 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Let's be user-friendly and print an actually helpful parameter description.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
drivers/gpu/drm/drm_drv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..49b658069b51 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,15 +37,24 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/*
- drm_debug: Enable debug output.
- Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
- */
+unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enables debug output, where each bit enables a debug category.\n"
Please keep it as "Enable".
+"Bit 0 (0x1) will enable CORE messages (drm core code)\n" +"Bit 1 (0x2) will enable DRIVER messages (drm controller code)\n" +"Bit 2 (0x4) will enable KMS messages (modesetting code)\n" +"Bit 3 (0x8) will enable PRMIE messages (prime code)\n");
Maybe prefix the continuation lines with a space or a tab? The last line probably shouldn't contain \n. See what modinfo(8) displays and make it pretty.
module_param_named(debug, drm_debug, int, 0600);
Spurious whitepace.
static DEFINE_SPINLOCK(drm_minor_lock); static struct idr drm_minors_idr;
(Adding Dave again)
On 20 April 2016 at 06:21, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 19 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Let's be user-friendly and print an actually helpful parameter description.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
drivers/gpu/drm/drm_drv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..49b658069b51 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,15 +37,24 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/*
- drm_debug: Enable debug output.
- Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
- */
+unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enables debug output, where each bit enables a debug category.\n"
Please keep it as "Enable".
+"Bit 0 (0x1) will enable CORE messages (drm core code)\n" +"Bit 1 (0x2) will enable DRIVER messages (drm controller code)\n" +"Bit 2 (0x4) will enable KMS messages (modesetting code)\n" +"Bit 3 (0x8) will enable PRMIE messages (prime code)\n");
Maybe prefix the continuation lines with a space or a tab? The last line probably shouldn't contain \n. See what modinfo(8) displays and make it pretty.
module_param_named(debug, drm_debug, int, 0600);
Spurious whitepace.
Thanks for the feedback. I'll post a v2.
Let's be user-friendly and print an actually helpful parameter description.
This makes modinfo output the debug parameter like this:
parm: debug:Enable debug output, where each bit enables a debug category. Bit 0 (0x01) will enable CORE messages (drm core code) Bit 1 (0x02) will enable DRIVER messages (drm controller code) Bit 2 (0x04) will enable KMS messages (modesetting code) Bit 3 (0x08) will enable PRIME messages (prime code) Bit 4 (0x10) will enable ATOMIC messages (atomic code) Bit 5 (0x20) will enable VBL messages (vblank code) (int)
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar -- Changes from v1:
* Fixed s/PRMIE/PRIME typo. * Add ATOMIC and VBL debug parameter documentation. * Prefix the continuation lines with two tabs and removed the last new line. * Remove spurious whitespace.
drivers/gpu/drm/drm_drv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..c4f45ac04ea4 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,13 +37,23 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/* + * drm_debug: Enable debug output. + * Bitmask of DRM_UT_x. See include/drm/drmP.h for details. + */ +unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" +"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" +"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" +"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" +"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" +"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" +"\t\tBit 5 (0x20) will enable VBL messages (vblank code)"); module_param_named(debug, drm_debug, int, 0600);
static DEFINE_SPINLOCK(drm_minor_lock);
On Wed, 20 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Let's be user-friendly and print an actually helpful parameter description.
This makes modinfo output the debug parameter like this:
parm: debug:Enable debug output, where each bit enables a debug category. Bit 0 (0x01) will enable CORE messages (drm core code) Bit 1 (0x02) will enable DRIVER messages (drm controller code) Bit 2 (0x04) will enable KMS messages (modesetting code) Bit 3 (0x08) will enable PRIME messages (prime code) Bit 4 (0x10) will enable ATOMIC messages (atomic code) Bit 5 (0x20) will enable VBL messages (vblank code) (int)
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
Reviewed-by: Jani Nikula jani.nikula@intel.com
-- Changes from v1:
- Fixed s/PRMIE/PRIME typo.
- Add ATOMIC and VBL debug parameter documentation.
- Prefix the continuation lines with two tabs and removed the last new line.
- Remove spurious whitespace.
drivers/gpu/drm/drm_drv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..c4f45ac04ea4 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,13 +37,23 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/*
- drm_debug: Enable debug output.
- Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
- */
+unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" +"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" +"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" +"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" +"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" +"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" +"\t\tBit 5 (0x20) will enable VBL messages (vblank code)"); module_param_named(debug, drm_debug, int, 0600);
static DEFINE_SPINLOCK(drm_minor_lock);
On Thu, Apr 21, 2016 at 10:32:11AM +0300, Jani Nikula wrote:
On Wed, 20 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Let's be user-friendly and print an actually helpful parameter description.
This makes modinfo output the debug parameter like this:
parm: debug:Enable debug output, where each bit enables a debug category. Bit 0 (0x01) will enable CORE messages (drm core code) Bit 1 (0x02) will enable DRIVER messages (drm controller code) Bit 2 (0x04) will enable KMS messages (modesetting code) Bit 3 (0x08) will enable PRIME messages (prime code) Bit 4 (0x10) will enable ATOMIC messages (atomic code) Bit 5 (0x20) will enable VBL messages (vblank code) (int)
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
Reviewed-by: Jani Nikula jani.nikula@intel.com
Applied to drm-misc, thanks. -Daniel
-- Changes from v1:
- Fixed s/PRMIE/PRIME typo.
- Add ATOMIC and VBL debug parameter documentation.
- Prefix the continuation lines with two tabs and removed the last new line.
- Remove spurious whitespace.
drivers/gpu/drm/drm_drv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 167c8d3d4a31..c4f45ac04ea4 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -37,13 +37,23 @@ #include "drm_legacy.h" #include "drm_internal.h"
-unsigned int drm_debug = 0; /* bitmask of DRM_UT_x */ +/*
- drm_debug: Enable debug output.
- Bitmask of DRM_UT_x. See include/drm/drmP.h for details.
- */
+unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug);
MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); -MODULE_PARM_DESC(debug, "Enable debug output"); +MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" +"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" +"\t\tBit 1 (0x02) will enable DRIVER messages (drm controller code)\n" +"\t\tBit 2 (0x04) will enable KMS messages (modesetting code)\n" +"\t\tBit 3 (0x08) will enable PRIME messages (prime code)\n" +"\t\tBit 4 (0x10) will enable ATOMIC messages (atomic code)\n" +"\t\tBit 5 (0x20) will enable VBL messages (vblank code)"); module_param_named(debug, drm_debug, int, 0600);
static DEFINE_SPINLOCK(drm_minor_lock);
-- Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Tue, 19 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Push the ifdef to the drm_edid.h and create a stub, for the DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in the code, making it more readable.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
Reviewed-by: Jani Nikula jani.nikula@intel.com
drivers/gpu/drm/drm_probe_helper.c | 2 -- include/drm/drm_edid.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index e714b5a7955f..0329080d7f7c 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, count = drm_add_edid_modes(connector, edid); drm_edid_to_eld(connector, edid); } else { -#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE count = drm_load_edid_firmware(connector); if (count == 0) -#endif count = (*connector_funcs->get_modes)(connector); }
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af97691e878..5996598bc778 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); struct drm_connector *drm_select_eld(struct drm_encoder *encoder);
+#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE int drm_load_edid_firmware(struct drm_connector *connector); +#else +static inline int drm_load_edid_firmware(struct drm_connector *connector) +{
- return 0;
+} +#endif
int drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
On Wed, Apr 20, 2016 at 12:24:16PM +0300, Jani Nikula wrote:
On Tue, 19 Apr 2016, Ezequiel Garcia ezequiel@vanguardiasur.com.ar wrote:
Push the ifdef to the drm_edid.h and create a stub, for the DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in the code, making it more readable.
Signed-off-by: Ezequiel Garcia ezequiel@vanguardiasur.com.ar
Reviewed-by: Jani Nikula jani.nikula@intel.com
Applied to drm-misc, thanks. -Daniel
drivers/gpu/drm/drm_probe_helper.c | 2 -- include/drm/drm_edid.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index e714b5a7955f..0329080d7f7c 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, count = drm_add_edid_modes(connector, edid); drm_edid_to_eld(connector, edid); } else { -#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE count = drm_load_edid_firmware(connector); if (count == 0) -#endif count = (*connector_funcs->get_modes)(connector); }
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 2af97691e878..5996598bc778 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); struct drm_connector *drm_select_eld(struct drm_encoder *encoder);
+#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE int drm_load_edid_firmware(struct drm_connector *connector); +#else +static inline int drm_load_edid_firmware(struct drm_connector *connector) +{
- return 0;
+} +#endif
int drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
-- Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
dri-devel@lists.freedesktop.org