[Nouveau] [PATCH v3] nouveau/dispnv50: add cursor pitch check

Simon Ser contact at emersion.fr
Fri Feb 5 22:38:58 UTC 2021


On Friday, February 5th, 2021 at 11:36 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> > --- a/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
> > +++ b/drivers/gpu/drm/nouveau/dispnv50/curs507a.c
> > @@ -30,6 +30,7 @@
> >
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_plane_helper.h>
> > +#include <drm/drm_fourcc.h>
>
> Why is this needed?

This is needed for the definition of struct drm_format_info.

> >  bool
> >  curs507a_space(struct nv50_wndw *wndw)
> > @@ -99,6 +100,8 @@ curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,
> >                  struct nv50_head_atom *asyh)
> >  {
> >         struct nv50_head *head = nv50_head(asyw->state.crtc);
> > +       struct nouveau_drm *drm = nouveau_drm(head->base.base.dev);
> > +       struct drm_framebuffer *fb = asyw->state.fb;
> >         int ret;
> >
> >         ret = drm_atomic_helper_check_plane_state(&asyw->state, &asyh->state,
> > @@ -109,14 +112,36 @@ curs507a_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,
> >         if (ret || !asyh->curs.visible)
> >                 return ret;
> >
> > -       if (asyw->image.w != asyw->image.h)
> > +       if (asyw->image.w != asyw->image.h) {
> > +               NV_ATOMIC(drm,
> > +                         "Invalid cursor image size: width (%d) must match height (%d)\n",
> > +                         asyw->image.w, asyw->image.h);
>
> Maybe keep with the style of the other NV_ATOMIC's, e.g. include %s:
> at the beginning with wndw->plane.name as the value?

Good idea.


More information about the Nouveau mailing list