All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: David Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/qxl: Replace deprecated function in qxl_display
Date: Sun, 31 May 2020 17:13:39 +0900	[thread overview]
Message-ID: <20200531081339.GA16336@realwakka-Lenovo-IdeaPad-S340-14API> (raw)
In-Reply-To: <CAMwc25pf=wmtQcog7D8GUJ6zz6ascFkExS+bsyA2E4chz-UcuQ@mail.gmail.com>

On Sun, May 24, 2020 at 07:42:25AM +1000, David Airlie wrote:
> On Sun, May 24, 2020 at 2:02 AM Sidong Yang <realwakka@gmail.com> wrote:
> >
> > Hi, Dave.
> >
> > I'm a newbie kernel developer interested in qxl driver. And I want to participate in
> > contributing for QXL module.
> > I wrote some simple patch for refactoring task found in todos in gpu documentation.
> > I want to know it's okay to contribute and write some patch for qxl module.
> > If this patch is wrong, please give me some advice for me.
> > Or if you have some simple task for me, I'll be glad to do it.
> > Thanks.
> 
> Hi Sidong,
> 
> The best way to start is probably to email dri-devel list rather than
> just me, there are a few more people there who can help with
> onboarding and accepting patches.
> 
> For QXL, Gerd Hoffmann (kraxel@redhat.com) is also worth cc'ing as he
> is mostly maintaining it at the moment.
> 
> Dave.
>

Thanks so much for advice Dave.
I'll add cc for qxl maintainer and dri-devel in next patch.

Sidong.
> 
> >
> > Sincerely,
> > Sidong.
> >
> > Replace deprecated function drm_modeset_lock/unlock_all with
> > helper function DRM_MODESET_LOCK_ALL_BEGIN/END.
> >
> > Signed-off-by: Sidong Yang <realwakka@gmail.com>
> > ---
> >  drivers/gpu/drm/qxl/qxl_display.c | 21 +++++++++++----------
> >  1 file changed, 11 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> > index 1082cd5d2fd4..07e164cee868 100644
> > --- a/drivers/gpu/drm/qxl/qxl_display.c
> > +++ b/drivers/gpu/drm/qxl/qxl_display.c
> > @@ -162,7 +162,8 @@ static void qxl_update_offset_props(struct qxl_device *qdev)
> >  void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
> >  {
> >         struct drm_device *dev = &qdev->ddev;
> > -       int status, retries;
> > +       struct drm_modeset_acquire_ctx ctx;
> > +       int status, retries, ret;
> >
> >         for (retries = 0; retries < 10; retries++) {
> >                 status = qxl_display_copy_rom_client_monitors_config(qdev);
> > @@ -183,9 +184,9 @@ void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
> >                 return;
> >         }
> >
> > -       drm_modeset_lock_all(dev);
> > +       DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
> >         qxl_update_offset_props(qdev);
> > -       drm_modeset_unlock_all(dev);
> > +       DRM_MODESET_LOCK_ALL_END(ctx, ret);
> >         if (!drm_helper_hpd_irq_event(dev)) {
> >                 /* notify that the monitor configuration changed, to
> >                    adjust at the arbitrary resolution */
> > @@ -403,18 +404,17 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
> >         struct qxl_device *qdev = to_qxl(fb->dev);
> >         struct drm_clip_rect norect;
> >         struct qxl_bo *qobj;
> > +       struct drm_modeset_acquire_ctx ctx;
> >         bool is_primary;
> > -       int inc = 1;
> > +       int inc = 1, ret;
> >
> > -       drm_modeset_lock_all(fb->dev);
> > +       DRM_MODESET_LOCK_ALL_BEGIN(fb->dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
> >
> >         qobj = gem_to_qxl_bo(fb->obj[0]);
> >         /* if we aren't primary surface ignore this */
> >         is_primary = qobj->shadow ? qobj->shadow->is_primary : qobj->is_primary;
> > -       if (!is_primary) {
> > -               drm_modeset_unlock_all(fb->dev);
> > -               return 0;
> > -       }
> > +       if (!is_primary)
> > +               goto out_lock_end;
> >
> >         if (!num_clips) {
> >                 num_clips = 1;
> > @@ -430,7 +430,8 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
> >         qxl_draw_dirty_fb(qdev, fb, qobj, flags, color,
> >                           clips, num_clips, inc, 0);
> >
> > -       drm_modeset_unlock_all(fb->dev);
> > +out_lock_end:
> > +       DRM_MODESET_LOCK_ALL_END(ctx, ret);
> >
> >         return 0;
> >  }
> > --
> > 2.17.1
> >
> 

WARNING: multiple messages have this Message-ID (diff)
From: Sidong Yang <realwakka@gmail.com>
To: David Airlie <airlied@redhat.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	Gerd Hoffmann <kraxel@redhat.com>,
	spice-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/qxl: Replace deprecated function in qxl_display
Date: Sun, 31 May 2020 17:13:39 +0900	[thread overview]
Message-ID: <20200531081339.GA16336@realwakka-Lenovo-IdeaPad-S340-14API> (raw)
In-Reply-To: <CAMwc25pf=wmtQcog7D8GUJ6zz6ascFkExS+bsyA2E4chz-UcuQ@mail.gmail.com>

On Sun, May 24, 2020 at 07:42:25AM +1000, David Airlie wrote:
> On Sun, May 24, 2020 at 2:02 AM Sidong Yang <realwakka@gmail.com> wrote:
> >
> > Hi, Dave.
> >
> > I'm a newbie kernel developer interested in qxl driver. And I want to participate in
> > contributing for QXL module.
> > I wrote some simple patch for refactoring task found in todos in gpu documentation.
> > I want to know it's okay to contribute and write some patch for qxl module.
> > If this patch is wrong, please give me some advice for me.
> > Or if you have some simple task for me, I'll be glad to do it.
> > Thanks.
> 
> Hi Sidong,
> 
> The best way to start is probably to email dri-devel list rather than
> just me, there are a few more people there who can help with
> onboarding and accepting patches.
> 
> For QXL, Gerd Hoffmann (kraxel@redhat.com) is also worth cc'ing as he
> is mostly maintaining it at the moment.
> 
> Dave.
>

Thanks so much for advice Dave.
I'll add cc for qxl maintainer and dri-devel in next patch.

Sidong.
> 
> >
> > Sincerely,
> > Sidong.
> >
> > Replace deprecated function drm_modeset_lock/unlock_all with
> > helper function DRM_MODESET_LOCK_ALL_BEGIN/END.
> >
> > Signed-off-by: Sidong Yang <realwakka@gmail.com>
> > ---
> >  drivers/gpu/drm/qxl/qxl_display.c | 21 +++++++++++----------
> >  1 file changed, 11 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> > index 1082cd5d2fd4..07e164cee868 100644
> > --- a/drivers/gpu/drm/qxl/qxl_display.c
> > +++ b/drivers/gpu/drm/qxl/qxl_display.c
> > @@ -162,7 +162,8 @@ static void qxl_update_offset_props(struct qxl_device *qdev)
> >  void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
> >  {
> >         struct drm_device *dev = &qdev->ddev;
> > -       int status, retries;
> > +       struct drm_modeset_acquire_ctx ctx;
> > +       int status, retries, ret;
> >
> >         for (retries = 0; retries < 10; retries++) {
> >                 status = qxl_display_copy_rom_client_monitors_config(qdev);
> > @@ -183,9 +184,9 @@ void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
> >                 return;
> >         }
> >
> > -       drm_modeset_lock_all(dev);
> > +       DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
> >         qxl_update_offset_props(qdev);
> > -       drm_modeset_unlock_all(dev);
> > +       DRM_MODESET_LOCK_ALL_END(ctx, ret);
> >         if (!drm_helper_hpd_irq_event(dev)) {
> >                 /* notify that the monitor configuration changed, to
> >                    adjust at the arbitrary resolution */
> > @@ -403,18 +404,17 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
> >         struct qxl_device *qdev = to_qxl(fb->dev);
> >         struct drm_clip_rect norect;
> >         struct qxl_bo *qobj;
> > +       struct drm_modeset_acquire_ctx ctx;
> >         bool is_primary;
> > -       int inc = 1;
> > +       int inc = 1, ret;
> >
> > -       drm_modeset_lock_all(fb->dev);
> > +       DRM_MODESET_LOCK_ALL_BEGIN(fb->dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret);
> >
> >         qobj = gem_to_qxl_bo(fb->obj[0]);
> >         /* if we aren't primary surface ignore this */
> >         is_primary = qobj->shadow ? qobj->shadow->is_primary : qobj->is_primary;
> > -       if (!is_primary) {
> > -               drm_modeset_unlock_all(fb->dev);
> > -               return 0;
> > -       }
> > +       if (!is_primary)
> > +               goto out_lock_end;
> >
> >         if (!num_clips) {
> >                 num_clips = 1;
> > @@ -430,7 +430,8 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
> >         qxl_draw_dirty_fb(qdev, fb, qobj, flags, color,
> >                           clips, num_clips, inc, 0);
> >
> > -       drm_modeset_unlock_all(fb->dev);
> > +out_lock_end:
> > +       DRM_MODESET_LOCK_ALL_END(ctx, ret);
> >
> >         return 0;
> >  }
> > --
> > 2.17.1
> >
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

       reply	other threads:[~2020-05-31  8:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200523160156.32511-1-realwakka@gmail.com>
     [not found] ` <CAMwc25pf=wmtQcog7D8GUJ6zz6ascFkExS+bsyA2E4chz-UcuQ@mail.gmail.com>
2020-05-31  8:13   ` Sidong Yang [this message]
2020-05-31  8:13     ` [PATCH] drm/qxl: Replace deprecated function in qxl_display Sidong Yang
2020-05-24  2:26 Sidong Yang
2020-05-24  2:26 ` Sidong Yang
2020-08-17 11:08 ` Gerd Hoffmann
2020-08-17 11:08   ` Gerd Hoffmann
2020-08-17 11:08   ` Gerd Hoffmann

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=20200531081339.GA16336@realwakka-Lenovo-IdeaPad-S340-14API \
    --to=realwakka@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 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.