Jani Nikula
2019-Sep-24 12:58 UTC
[Nouveau] [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
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 at intel.com> Cc: Alex Deucher <alexander.deucher at amd.com> Cc: Christian König <christian.koenig at amd.com> Cc: David (ChunMing) Zhou <David1.Zhou at amd.com> Cc: amd-gfx at lists.freedesktop.org Cc: Ben Skeggs <bskeggs at redhat.com> Cc: nouveau at lists.freedesktop.org Cc: Rob Clark <robdclark at gmail.com> Cc: Sean Paul <sean at poorly.run> Cc: linux-arm-msm at vger.kernel.org Cc: freedreno at lists.freedesktop.org Cc: Francisco Jerez <currojerez at riseup.net> Cc: Lucas Stach <l.stach at pengutronix.de> Cc: Russell King <linux+etnaviv at armlinux.org.uk> Cc: Christian Gmeiner <christian.gmeiner at gmail.com> Cc: etnaviv at lists.freedesktop.org [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula at 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
Jani Nikula
2019-Sep-24 12:59 UTC
[Nouveau] [PATCH v2 7/9] drm/nouveau: use drm_debug_enabled() to check for debug categories
Allow better abstraction of the drm_debug global variable in the future. No functional changes. v2: move unlikely() to drm_debug_enabled() Cc: Ben Skeggs <bskeggs at redhat.com> Cc: nouveau at lists.freedesktop.org Signed-off-by: Jani Nikula <jani.nikula at intel.com> --- drivers/gpu/drm/nouveau/dispnv50/disp.h | 4 ++-- drivers/gpu/drm/nouveau/nouveau_drv.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h index 7c41b0599d1a..c0a79531b087 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.h +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h @@ -78,14 +78,14 @@ void evo_kick(u32 *, struct nv50_dmac *); #define evo_mthd(p, m, s) do { \ const u32 _m = (m), _s = (s); \ - if (drm_debug & DRM_UT_KMS) \ + if (drm_debug_enabled(DRM_UT_KMS)) \ pr_err("%04x %d %s\n", _m, _s, __func__); \ *((p)++) = ((_s << 18) | _m); \ } while(0) #define evo_data(p, d) do { \ const u32 _d = (d); \ - if (drm_debug & DRM_UT_KMS) \ + if (drm_debug_enabled(DRM_UT_KMS)) \ pr_err("\t%08x\n", _d); \ *((p)++) = _d; \ } while(0) diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 70f34cacc552..da8c46e09943 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h @@ -248,11 +248,11 @@ void nouveau_drm_device_remove(struct drm_device *dev); #define NV_INFO(drm,f,a...) NV_PRINTK(info, &(drm)->client, f, ##a) #define NV_DEBUG(drm,f,a...) do { \ - if (unlikely(drm_debug & DRM_UT_DRIVER)) \ + if (drm_debug_enabled(DRM_UT_DRIVER)) \ NV_PRINTK(info, &(drm)->client, f, ##a); \ } while(0) #define NV_ATOMIC(drm,f,a...) do { \ - if (unlikely(drm_debug & DRM_UT_ATOMIC)) \ + if (drm_debug_enabled(DRM_UT_ATOMIC)) \ NV_PRINTK(info, &(drm)->client, f, ##a); \ } while(0) -- 2.20.1
Eric Engestrom
2019-Sep-26 07:56 UTC
[Nouveau] [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
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 at intel.com> > Cc: Alex Deucher <alexander.deucher at amd.com> > Cc: Christian K?nig <christian.koenig at amd.com> > Cc: David (ChunMing) Zhou <David1.Zhou at amd.com> > Cc: amd-gfx at lists.freedesktop.org > Cc: Ben Skeggs <bskeggs at redhat.com> > Cc: nouveau at lists.freedesktop.org > Cc: Rob Clark <robdclark at gmail.com> > Cc: Sean Paul <sean at poorly.run> > Cc: linux-arm-msm at vger.kernel.org > Cc: freedreno at lists.freedesktop.org > Cc: Francisco Jerez <currojerez at riseup.net> > Cc: Lucas Stach <l.stach at pengutronix.de> > Cc: Russell King <linux+etnaviv at armlinux.org.uk> > Cc: Christian Gmeiner <christian.gmeiner at gmail.com> > Cc: etnaviv at lists.freedesktop.org > > > [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula at 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 useThe above four patches are: Reviewed-by: Eric Engestrom <eric at engestrom.ch> Did you check to make sure the `unlikely()` is propagated correctly outside the `drm_debug_enabled()` call?
Jani Nikula
2019-Oct-01 11:03 UTC
[Nouveau] [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
On Thu, 26 Sep 2019, Eric Engestrom <eric at 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 at intel.com> >> Cc: Alex Deucher <alexander.deucher at amd.com> >> Cc: Christian König <christian.koenig at amd.com> >> Cc: David (ChunMing) Zhou <David1.Zhou at amd.com> >> Cc: amd-gfx at lists.freedesktop.org >> Cc: Ben Skeggs <bskeggs at redhat.com> >> Cc: nouveau at lists.freedesktop.org >> Cc: Rob Clark <robdclark at gmail.com> >> Cc: Sean Paul <sean at poorly.run> >> Cc: linux-arm-msm at vger.kernel.org >> Cc: freedreno at lists.freedesktop.org >> Cc: Francisco Jerez <currojerez at riseup.net> >> Cc: Lucas Stach <l.stach at pengutronix.de> >> Cc: Russell King <linux+etnaviv at armlinux.org.uk> >> Cc: Christian Gmeiner <christian.gmeiner at gmail.com> >> Cc: etnaviv at lists.freedesktop.org >> >> >> [1] http://mid.mail-archive.com/cover.1568375189.git.jani.nikula at 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 at 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
Jani Nikula
2019-Oct-02 14:11 UTC
[Nouveau] [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
On Tue, 24 Sep 2019, Jani Nikula <jani.nikula at 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 categoriesPushed 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 useBR, Jani. -- Jani Nikula, Intel Open Source Graphics Center
Reasonably Related Threads
- [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
- [PATCH 0/9] drm/print: add and use drm_debug_enabled()
- [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
- [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()
- [PATCH v2 0/9] drm/print: add and use drm_debug_enabled()