* [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
@ 2019-09-24 12:58 Jani Nikula
2019-09-24 12:59 ` [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories Jani Nikula
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jani Nikula @ 2019-09-24 12:58 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: David Zhou, Francisco Jerez, jani.nikula-ral2JQCrhuEAvxtiuMwx3w,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Russell King,
Christian Gmeiner, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Eric Engestrom,
Rob Clark, Ben Skeggs, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
Alex Deucher, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
Sean Paul, Christian König, Lucas Stach
Hi all, v2 of [1], a little refactoring around drm_debug access to
abstract it better. There shouldn't be any functional changes.
I'd appreciate acks for merging the lot via drm-misc. If there are any
objections to that, we'll need to postpone the last patch until
everything has been merged and converted in drm-next.
BR,
Jani.
Cc: Eric Engestrom <eric.engestrom@intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: David (ChunMing) Zhou <David1.Zhou@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: nouveau@lists.freedesktop.org
Cc: Rob Clark <robdclark@gmail.com>
Cc: Sean Paul <sean@poorly.run>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: Francisco Jerez <currojerez@riseup.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: etnaviv@lists.freedesktop.org
[1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com
Jani Nikula (9):
drm/print: move drm_debug variable to drm_print.[ch]
drm/print: add drm_debug_enabled()
drm/etnaviv: use drm_debug_enabled() to check for debug categories
drm/i2c/sil164: use drm_debug_enabled() to check for debug categories
drm/i915: use drm_debug_enabled() to check for debug categories
drm/msm: use drm_debug_enabled() to check for debug categories
drm/nouveau: use drm_debug_enabled() to check for debug categories
drm/amdgpu: use drm_debug_enabled() to check for debug categories
drm/print: rename drm_debug to __drm_debug to discourage use
drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 4 ++--
drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++---
drivers/gpu/drm/drm_drv.c | 17 ---------------
drivers/gpu/drm/drm_edid.c | 2 +-
drivers/gpu/drm/drm_edid_load.c | 2 +-
drivers/gpu/drm/drm_mipi_dbi.c | 4 ++--
drivers/gpu/drm/drm_print.c | 23 ++++++++++++++++++--
drivers/gpu/drm/drm_vblank.c | 6 ++---
drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 8 +++----
drivers/gpu/drm/i2c/sil164_drv.c | 2 +-
drivers/gpu/drm/i915/display/intel_display.c | 4 ++--
drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 2 +-
drivers/gpu/drm/i915/i915_gem.h | 2 +-
drivers/gpu/drm/i915/i915_utils.c | 2 +-
drivers/gpu/drm/i915/intel_pm.c | 2 +-
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 4 ++--
drivers/gpu/drm/nouveau/dispnv50/disp.h | 4 ++--
drivers/gpu/drm/nouveau/nouveau_drv.h | 4 ++--
include/drm/drm_drv.h | 2 --
include/drm/drm_print.h | 8 +++++++
22 files changed, 60 insertions(+), 52 deletions(-)
--
2.20.1
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories 2019-09-24 12:58 [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() Jani Nikula @ 2019-09-24 12:59 ` Jani Nikula 2019-09-24 17:44 ` Alex Deucher 2019-09-26 7:48 ` [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() Eric Engestrom [not found] ` <cover.1569329774.git.jani.nikula-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2 siblings, 1 reply; 8+ messages in thread From: Jani Nikula @ 2019-09-24 12:59 UTC (permalink / raw) To: dri-devel Cc: jani.nikula, intel-gfx, amd-gfx, Alex Deucher, Christian König Allow better abstraction of the drm_debug global variable in the future. No functional changes. Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c index 4a5951036927..5f17bd4899e2 100644 --- a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +++ b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c @@ -234,7 +234,7 @@ static uint32_t smu_v11_0_i2c_transmit(struct i2c_adapter *control, DRM_DEBUG_DRIVER("I2C_Transmit(), address = %x, bytes = %d , data: ", (uint16_t)address, numbytes); - if (drm_debug & DRM_UT_DRIVER) { + if (drm_debug_enabled(DRM_UT_DRIVER)) { print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, 16, 1, data, numbytes, false); } @@ -388,7 +388,7 @@ static uint32_t smu_v11_0_i2c_receive(struct i2c_adapter *control, DRM_DEBUG_DRIVER("I2C_Receive(), address = %x, bytes = %d, data :", (uint16_t)address, bytes_received); - if (drm_debug & DRM_UT_DRIVER) { + if (drm_debug_enabled(DRM_UT_DRIVER)) { print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, 16, 1, data, bytes_received, false); } -- 2.20.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories 2019-09-24 12:59 ` [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories Jani Nikula @ 2019-09-24 17:44 ` Alex Deucher 0 siblings, 0 replies; 8+ messages in thread From: Alex Deucher @ 2019-09-24 17:44 UTC (permalink / raw) To: Jani Nikula Cc: Alex Deucher, Intel Graphics Development, amd-gfx list, Maling list - DRI developers, Christian König On Tue, Sep 24, 2019 at 9:00 AM Jani Nikula <jani.nikula@intel.com> wrote: > > Allow better abstraction of the drm_debug global variable in the > future. No functional changes. > > Cc: Alex Deucher <alexander.deucher@amd.com> > Cc: Christian König <christian.koenig@amd.com> > Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> > Cc: amd-gfx@lists.freedesktop.org > Signed-off-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c > index 4a5951036927..5f17bd4899e2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c > +++ b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c > @@ -234,7 +234,7 @@ static uint32_t smu_v11_0_i2c_transmit(struct i2c_adapter *control, > DRM_DEBUG_DRIVER("I2C_Transmit(), address = %x, bytes = %d , data: ", > (uint16_t)address, numbytes); > > - if (drm_debug & DRM_UT_DRIVER) { > + if (drm_debug_enabled(DRM_UT_DRIVER)) { > print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, > 16, 1, data, numbytes, false); > } > @@ -388,7 +388,7 @@ static uint32_t smu_v11_0_i2c_receive(struct i2c_adapter *control, > DRM_DEBUG_DRIVER("I2C_Receive(), address = %x, bytes = %d, data :", > (uint16_t)address, bytes_received); > > - if (drm_debug & DRM_UT_DRIVER) { > + if (drm_debug_enabled(DRM_UT_DRIVER)) { > print_hex_dump(KERN_INFO, "data: ", DUMP_PREFIX_NONE, > 16, 1, data, bytes_received, false); > } > -- > 2.20.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() 2019-09-24 12:58 [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() Jani Nikula 2019-09-24 12:59 ` [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories Jani Nikula @ 2019-09-26 7:48 ` Eric Engestrom [not found] ` <20190926074814.rdzxjmut6izqf4d5-op+oiCINJLTt9jDmeYuA0g@public.gmane.org> [not found] ` <cover.1569329774.git.jani.nikula-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2 siblings, 1 reply; 8+ messages in thread From: Eric Engestrom @ 2019-09-26 7:48 UTC (permalink / raw) To: Jani Nikula Cc: nouveau, intel-gfx, Russell King, amd-gfx, etnaviv, dri-devel, linux-arm-msm, Alex Deucher, freedreno, Sean Paul, Christian König, Ben Skeggs On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote: > Hi all, v2 of [1], a little refactoring around drm_debug access to > abstract it better. There shouldn't be any functional changes. > > I'd appreciate acks for merging the lot via drm-misc. If there are any > objections to that, we'll need to postpone the last patch until > everything has been merged and converted in drm-next. > > BR, > Jani. > > Cc: Eric Engestrom <eric.engestrom@intel.com> > Cc: Alex Deucher <alexander.deucher@amd.com> > Cc: Christian König <christian.koenig@amd.com> > Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> > Cc: amd-gfx@lists.freedesktop.org > Cc: Ben Skeggs <bskeggs@redhat.com> > Cc: nouveau@lists.freedesktop.org > Cc: Rob Clark <robdclark@gmail.com> > Cc: Sean Paul <sean@poorly.run> > Cc: linux-arm-msm@vger.kernel.org > Cc: freedreno@lists.freedesktop.org > Cc: Francisco Jerez <currojerez@riseup.net> > Cc: Lucas Stach <l.stach@pengutronix.de> > Cc: Russell King <linux+etnaviv@armlinux.org.uk> > Cc: Christian Gmeiner <christian.gmeiner@gmail.com> > Cc: etnaviv@lists.freedesktop.org > > > [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com > > Jani Nikula (9): > drm/print: move drm_debug variable to drm_print.[ch] > drm/print: add drm_debug_enabled() > drm/i915: use drm_debug_enabled() to check for debug categories > drm/print: rename drm_debug to __drm_debug to discourage use The above four patches are: Reviewed-by: Eric Engestrom <eric@engestrom.ch> Did you check to make sure the `unlikely()` is propagated correctly outside the `drm_debug_enabled()` call? _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20190926074814.rdzxjmut6izqf4d5-op+oiCINJLTt9jDmeYuA0g@public.gmane.org>]
* Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() [not found] ` <20190926074814.rdzxjmut6izqf4d5-op+oiCINJLTt9jDmeYuA0g@public.gmane.org> @ 2019-10-01 11:03 ` Jani Nikula [not found] ` <875zl8d8x0.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Jani Nikula @ 2019-10-01 11:03 UTC (permalink / raw) To: Eric Engestrom Cc: David Zhou, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Russell King, Christian Gmeiner, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Lucas Stach, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Alex Deucher, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sean Paul, Christian König, Ben Skeggs On Thu, 26 Sep 2019, Eric Engestrom <eric@engestrom.ch> wrote: > On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote: >> Hi all, v2 of [1], a little refactoring around drm_debug access to >> abstract it better. There shouldn't be any functional changes. >> >> I'd appreciate acks for merging the lot via drm-misc. If there are any >> objections to that, we'll need to postpone the last patch until >> everything has been merged and converted in drm-next. >> >> BR, >> Jani. >> >> Cc: Eric Engestrom <eric.engestrom@intel.com> >> Cc: Alex Deucher <alexander.deucher@amd.com> >> Cc: Christian König <christian.koenig@amd.com> >> Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> >> Cc: amd-gfx@lists.freedesktop.org >> Cc: Ben Skeggs <bskeggs@redhat.com> >> Cc: nouveau@lists.freedesktop.org >> Cc: Rob Clark <robdclark@gmail.com> >> Cc: Sean Paul <sean@poorly.run> >> Cc: linux-arm-msm@vger.kernel.org >> Cc: freedreno@lists.freedesktop.org >> Cc: Francisco Jerez <currojerez@riseup.net> >> Cc: Lucas Stach <l.stach@pengutronix.de> >> Cc: Russell King <linux+etnaviv@armlinux.org.uk> >> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> >> Cc: etnaviv@lists.freedesktop.org >> >> >> [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com >> >> Jani Nikula (9): >> drm/print: move drm_debug variable to drm_print.[ch] >> drm/print: add drm_debug_enabled() >> drm/i915: use drm_debug_enabled() to check for debug categories >> drm/print: rename drm_debug to __drm_debug to discourage use > > The above four patches are: > Reviewed-by: Eric Engestrom <eric@engestrom.ch> > > Did you check to make sure the `unlikely()` is propagated correctly > outside the `drm_debug_enabled()` call? I did now. Having drm_debug_enabled() as a macro vs. as an inline function does not seem to make a difference, so I think the inline is clearly preferrable. However, for example unlikely(foo && drm_debug & DRM_UT_DP) does produce code different from (foo && drm_debug_enabled(DRM_UT_DP)) indicating that the unlikely() within drm_debug_enabled() does not propagate to the whole condition. It's possible to retain the same assembly output with (unlikely(foo) && drm_debug_enabled(DRM_UT_DP)) but it's unclear to me whether this is really worth it, either readability or performance wise. Thoughts? BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <875zl8d8x0.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() [not found] ` <875zl8d8x0.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2019-10-01 12:34 ` Eric Engestrom [not found] ` <20191001123444.xtp7wpickwjus4m2-op+oiCINJLTt9jDmeYuA0g@public.gmane.org> 0 siblings, 1 reply; 8+ messages in thread From: Eric Engestrom @ 2019-10-01 12:34 UTC (permalink / raw) To: Jani Nikula Cc: David Zhou, Francisco Jerez, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Russell King, Christian Gmeiner, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Lucas Stach, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Alex Deucher, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sean Paul, Christian König, Ben Skeggs On Tuesday, 2019-10-01 14:03:55 +0300, Jani Nikula wrote: > On Thu, 26 Sep 2019, Eric Engestrom <eric@engestrom.ch> wrote: > > On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote: > >> Hi all, v2 of [1], a little refactoring around drm_debug access to > >> abstract it better. There shouldn't be any functional changes. > >> > >> I'd appreciate acks for merging the lot via drm-misc. If there are any > >> objections to that, we'll need to postpone the last patch until > >> everything has been merged and converted in drm-next. > >> > >> BR, > >> Jani. > >> > >> Cc: Eric Engestrom <eric.engestrom@intel.com> > >> Cc: Alex Deucher <alexander.deucher@amd.com> > >> Cc: Christian König <christian.koenig@amd.com> > >> Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> > >> Cc: amd-gfx@lists.freedesktop.org > >> Cc: Ben Skeggs <bskeggs@redhat.com> > >> Cc: nouveau@lists.freedesktop.org > >> Cc: Rob Clark <robdclark@gmail.com> > >> Cc: Sean Paul <sean@poorly.run> > >> Cc: linux-arm-msm@vger.kernel.org > >> Cc: freedreno@lists.freedesktop.org > >> Cc: Francisco Jerez <currojerez@riseup.net> > >> Cc: Lucas Stach <l.stach@pengutronix.de> > >> Cc: Russell King <linux+etnaviv@armlinux.org.uk> > >> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> > >> Cc: etnaviv@lists.freedesktop.org > >> > >> > >> [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com > >> > >> Jani Nikula (9): > >> drm/print: move drm_debug variable to drm_print.[ch] > >> drm/print: add drm_debug_enabled() > >> drm/i915: use drm_debug_enabled() to check for debug categories > >> drm/print: rename drm_debug to __drm_debug to discourage use > > > > The above four patches are: > > Reviewed-by: Eric Engestrom <eric@engestrom.ch> > > > > Did you check to make sure the `unlikely()` is propagated correctly > > outside the `drm_debug_enabled()` call? > > I did now. > > Having drm_debug_enabled() as a macro vs. as an inline function does not > seem to make a difference, so I think the inline is clearly preferrable. Agreed :) > > However, for example > > unlikely(foo && drm_debug & DRM_UT_DP) > > does produce code different from > > (foo && drm_debug_enabled(DRM_UT_DP)) > > indicating that the unlikely() within drm_debug_enabled() does not > propagate to the whole condition. It's possible to retain the same > assembly output with > > (unlikely(foo) && drm_debug_enabled(DRM_UT_DP)) > > but it's unclear to me whether this is really worth it, either > readability or performance wise. > > Thoughts? That kind of code only happens 2 times, both in drivers/gpu/drm/drm_dp_mst_topology.c (in patch 2/9), right? I think your suggestion is the right thing to do here: - if (unlikely(ret && drm_debug & DRM_UT_DP)) { + if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) { It doesn't really cost much in readability (especially compared to what it was before), and whether it's important performance wise I couldn't tell, but I think it's best to keep the code optimised as it was before unless there's a reason to drop it. Lyude might know more since she wrote 2f015ec6eab69301fdcf5, if you want to ping her? > > BR, > Jani. > > > -- > Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20191001123444.xtp7wpickwjus4m2-op+oiCINJLTt9jDmeYuA0g@public.gmane.org>]
* Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() [not found] ` <20191001123444.xtp7wpickwjus4m2-op+oiCINJLTt9jDmeYuA0g@public.gmane.org> @ 2019-10-01 14:08 ` Jani Nikula 0 siblings, 0 replies; 8+ messages in thread From: Jani Nikula @ 2019-10-01 14:08 UTC (permalink / raw) To: Eric Engestrom Cc: David Zhou, Francisco Jerez, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Russell King, Christian Gmeiner, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Rob Clark, Lucas Stach, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Alex Deucher, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sean Paul, Christian König, Ben Skeggs On Tue, 01 Oct 2019, Eric Engestrom <eric@engestrom.ch> wrote: > On Tuesday, 2019-10-01 14:03:55 +0300, Jani Nikula wrote: >> On Thu, 26 Sep 2019, Eric Engestrom <eric@engestrom.ch> wrote: >> > On Tuesday, 2019-09-24 15:58:56 +0300, Jani Nikula wrote: >> >> Hi all, v2 of [1], a little refactoring around drm_debug access to >> >> abstract it better. There shouldn't be any functional changes. >> >> >> >> I'd appreciate acks for merging the lot via drm-misc. If there are any >> >> objections to that, we'll need to postpone the last patch until >> >> everything has been merged and converted in drm-next. >> >> >> >> BR, >> >> Jani. >> >> >> >> Cc: Eric Engestrom <eric.engestrom@intel.com> >> >> Cc: Alex Deucher <alexander.deucher@amd.com> >> >> Cc: Christian König <christian.koenig@amd.com> >> >> Cc: David (ChunMing) Zhou <David1.Zhou@amd.com> >> >> Cc: amd-gfx@lists.freedesktop.org >> >> Cc: Ben Skeggs <bskeggs@redhat.com> >> >> Cc: nouveau@lists.freedesktop.org >> >> Cc: Rob Clark <robdclark@gmail.com> >> >> Cc: Sean Paul <sean@poorly.run> >> >> Cc: linux-arm-msm@vger.kernel.org >> >> Cc: freedreno@lists.freedesktop.org >> >> Cc: Francisco Jerez <currojerez@riseup.net> >> >> Cc: Lucas Stach <l.stach@pengutronix.de> >> >> Cc: Russell King <linux+etnaviv@armlinux.org.uk> >> >> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> >> >> Cc: etnaviv@lists.freedesktop.org >> >> >> >> >> >> [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula@intel.com >> >> >> >> Jani Nikula (9): >> >> drm/print: move drm_debug variable to drm_print.[ch] >> >> drm/print: add drm_debug_enabled() >> >> drm/i915: use drm_debug_enabled() to check for debug categories >> >> drm/print: rename drm_debug to __drm_debug to discourage use >> > >> > The above four patches are: >> > Reviewed-by: Eric Engestrom <eric@engestrom.ch> >> > >> > Did you check to make sure the `unlikely()` is propagated correctly >> > outside the `drm_debug_enabled()` call? >> >> I did now. >> >> Having drm_debug_enabled() as a macro vs. as an inline function does not >> seem to make a difference, so I think the inline is clearly preferrable. > > Agreed :) > >> >> However, for example >> >> unlikely(foo && drm_debug & DRM_UT_DP) >> >> does produce code different from >> >> (foo && drm_debug_enabled(DRM_UT_DP)) >> >> indicating that the unlikely() within drm_debug_enabled() does not >> propagate to the whole condition. It's possible to retain the same >> assembly output with >> >> (unlikely(foo) && drm_debug_enabled(DRM_UT_DP)) >> >> but it's unclear to me whether this is really worth it, either >> readability or performance wise. >> >> Thoughts? > > That kind of code only happens 2 times, both in > drivers/gpu/drm/drm_dp_mst_topology.c (in patch 2/9), right? > > I think your suggestion is the right thing to do here: > > - if (unlikely(ret && drm_debug & DRM_UT_DP)) { > + if (unlikely(ret) && drm_debug_enabled(DRM_UT_DP)) { > > It doesn't really cost much in readability (especially compared to what > it was before), and whether it's important performance wise I couldn't > tell, but I think it's best to keep the code optimised as it was before > unless there's a reason to drop it. > > Lyude might know more since she wrote 2f015ec6eab69301fdcf5, if you want > to ping her? Just ended up sending the updated version with what you suggest and I agree with; pedantically the change should be a separate patch anyway. Thanks for your inputs. BR, Jani. > >> >> BR, >> Jani. >> >> >> -- >> Jani Nikula, Intel Open Source Graphics Center -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <cover.1569329774.git.jani.nikula-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() [not found] ` <cover.1569329774.git.jani.nikula-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2019-10-02 14:11 ` Jani Nikula 0 siblings, 0 replies; 8+ messages in thread From: Jani Nikula @ 2019-10-02 14:11 UTC (permalink / raw) To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW Cc: David Zhou, Francisco Jerez, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Russell King, Christian Gmeiner, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Eric Engestrom, Rob Clark, Ben Skeggs, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA, Alex Deucher, freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Sean Paul, Christian König, Lucas Stach On Tue, 24 Sep 2019, Jani Nikula <jani.nikula@intel.com> wrote: > drm/print: move drm_debug variable to drm_print.[ch] > drm/print: add drm_debug_enabled() > drm/etnaviv: use drm_debug_enabled() to check for debug categories > drm/i2c/sil164: use drm_debug_enabled() to check for debug categories > drm/msm: use drm_debug_enabled() to check for debug categories Pushed the above patches to drm-misc-next, thanks for the reviews and acks! The below i915 and amdgpu patches conflict on drm-misc-next, and I haven't received any feedback on nouveau. > drm/i915: use drm_debug_enabled() to check for debug categories > drm/nouveau: use drm_debug_enabled() to check for debug categories > drm/amdgpu: use drm_debug_enabled() to check for debug categories > drm/print: rename drm_debug to __drm_debug to discourage use BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Freedreno mailing list Freedreno@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/freedreno ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-10-02 14:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24 12:58 [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() Jani Nikula
2019-09-24 12:59 ` [PATCH v2 8/9] drm/amdgpu: use drm_debug_enabled() to check for debug categories Jani Nikula
2019-09-24 17:44 ` Alex Deucher
2019-09-26 7:48 ` [PATCH v2 0/9] drm/print: add and use drm_debug_enabled() Eric Engestrom
[not found] ` <20190926074814.rdzxjmut6izqf4d5-op+oiCINJLTt9jDmeYuA0g@public.gmane.org>
2019-10-01 11:03 ` Jani Nikula
[not found] ` <875zl8d8x0.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-10-01 12:34 ` Eric Engestrom
[not found] ` <20191001123444.xtp7wpickwjus4m2-op+oiCINJLTt9jDmeYuA0g@public.gmane.org>
2019-10-01 14:08 ` Jani Nikula
[not found] ` <cover.1569329774.git.jani.nikula-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2019-10-02 14:11 ` Jani Nikula
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox