From: Jani Nikula <jani.nikula@linux.intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
open list <linux-kernel@vger.kernel.org>,
"open list\:INTEL DRM DRIVERS \(excluding Poulsbo\,
Moorestow..." <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/2] drm: move i915_kick_out_vgacon to drm_fb_helper
Date: Thu, 21 Feb 2019 16:41:56 +0200 [thread overview]
Message-ID: <877edttd8r.fsf@intel.com> (raw)
In-Reply-To: <20190221132528.7cyobqegunh6uoh2@sirius.home.kraxel.org>
On Thu, 21 Feb 2019, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Thu, Feb 21, 2019 at 03:08:39PM +0200, Jani Nikula wrote:
>> On Thu, 21 Feb 2019, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> > It'll be useful for other drivers too, so move it to drm_fb_helper.c
>> > (and rename it of course). Also add docs.
>> >
>> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>> > ---
>> > include/drm/drm_fb_helper.h | 2 ++
>> > drivers/gpu/drm/drm_fb_helper.c | 39 +++++++++++++++++++++++++++++++++++++++
>> > drivers/gpu/drm/i915/i915_drv.c | 35 +----------------------------------
>> > 3 files changed, 42 insertions(+), 34 deletions(-)
>> >
>> > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
>> > index bb9acea613..a401ba47ad 100644
>> > --- a/include/drm/drm_fb_helper.h
>> > +++ b/include/drm/drm_fb_helper.h
>> > @@ -649,4 +649,6 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
>> > #endif
>> > }
>> >
>> > +int drm_fb_helper_kick_out_vgacon(void);
>> > +
>> > #endif
>> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> > index 0e9349ff2d..a2d7e5bc51 100644
>> > --- a/drivers/gpu/drm/drm_fb_helper.c
>> > +++ b/drivers/gpu/drm/drm_fb_helper.c
>> > @@ -35,6 +35,7 @@
>> > #include <linux/sysrq.h>
>> > #include <linux/slab.h>
>> > #include <linux/module.h>
>> > +#include <linux/vt_kern.h>
>> > #include <drm/drmP.h>
>> > #include <drm/drm_crtc.h>
>> > #include <drm/drm_fb_helper.h>
>> > @@ -3353,3 +3354,41 @@ int __init drm_fb_helper_modinit(void)
>> > return 0;
>> > }
>> > EXPORT_SYMBOL(drm_fb_helper_modinit);
>> > +
>> > +/**
>> > + * drm_fb_helper_kick_out_vgacon - deactivate vgacon driver.
>> > + *
>> > + * Deactivate vgacon driver so it stops accessing vga io ports.
>> > + * Should be called after
>> > + * drm_fb_helper_remove_conflicting_pci_framebuffers().
>> > + *
>> > + * Returns:
>> > + * Zero on success or negative error code on failure.
>> > + */
>> > +int drm_fb_helper_kick_out_vgacon(void)
>> > +{
>> > +#if !defined(CONFIG_VGA_CONSOLE)
>> > + return 0;
>> > +#elif !defined(CONFIG_DUMMY_CONSOLE)
>> > + return -ENODEV;
>> > +#else
>>
>> Please retain the original way of keeping conditional compilation
>> outside of functions.
>
> Care to explain why that is better?
Prevalent and documented [1] kernel coding style. It's easier to see
what happens in each branch, and the compiler throws the alternatives
away anyway.
Patches that do code movement should focus on code movement. Any
additional changes should be separate, and justified separately. The
function rename and documentation are of course okay, and they're
mentioned in the commit message as they should.
BR,
Jani.
[1] Documentation/process/coding-style.rst
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2019-02-21 14:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190221113534.20764-1-kraxel@redhat.com>
2019-02-21 11:35 ` [PATCH v2 2/2] drm/qxl: kick out vgacon Gerd Hoffmann
2019-02-21 12:20 ` Daniel Vetter
2019-02-21 13:06 ` Gerd Hoffmann
2019-02-21 14:24 ` Daniel Vetter
2019-02-21 15:11 ` Gerd Hoffmann
2019-02-21 15:17 ` Daniel Vetter
2019-02-22 7:14 ` Gerd Hoffmann
[not found] ` <20190221113534.20764-2-kraxel@redhat.com>
2019-02-21 13:08 ` [PATCH v2 1/2] drm: move i915_kick_out_vgacon to drm_fb_helper Jani Nikula
2019-02-21 13:25 ` Gerd Hoffmann
2019-02-21 14:41 ` Jani Nikula [this message]
2019-02-21 14:12 ` Noralf Trønnes
2019-02-21 15:09 ` Gerd Hoffmann
2019-02-21 15:51 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877edttd8r.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=rodrigo.vivi@intel.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox