[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190524111009.beddu67vvx66wvmk@DESKTOP-E1NTVVP.localdomain>
Date: Fri, 24 May 2019 11:10:09 +0000
From: Brian Starkey <Brian.Starkey@....com>
To: "james qian wang (Arm Technology China)" <james.qian.wang@....com>
CC: Ayan Halder <Ayan.Halder@....com>,
Liviu Dudau <Liviu.Dudau@....com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
"maarten.lankhorst@...ux.intel.com"
<maarten.lankhorst@...ux.intel.com>,
"sean@...rly.run" <sean@...rly.run>,
"Jonathan Chai (Arm Technology China)" <Jonathan.Chai@....com>,
"Julien Yin (Arm Technology China)" <Julien.Yin@....com>,
"thomas Sun (Arm Technology China)" <thomas.Sun@....com>,
"Lowry Li (Arm Technology China)" <Lowry.Li@....com>,
"Tiannan Zhu (Arm Technology China)" <Tiannan.Zhu@....com>,
"Yiqi Kang (Arm Technology China)" <Yiqi.Kang@....com>,
nd <nd@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/komeda: Added AFBC support for komeda driver
Hi,
On Tue, May 21, 2019 at 09:45:58AM +0100, james qian wang (Arm Technology China) wrote:
> On Thu, May 16, 2019 at 09:57:49PM +0800, Ayan Halder wrote:
> > On Thu, Apr 04, 2019 at 12:06:14PM +0100, james qian wang (Arm Technology China) wrote:
> > >
> > > +static int
> > > +komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file,
> > > + const struct drm_mode_fb_cmd2 *mode_cmd)
> > > +{
> > > + struct drm_framebuffer *fb = &kfb->base;
> > > + const struct drm_format_info *info = fb->format;
> > > + struct drm_gem_object *obj;
> > > + u32 alignment_w = 0, alignment_h = 0, alignment_header;
> > > + u32 n_blocks = 0, min_size = 0;
> > > +
> > > + obj = drm_gem_object_lookup(file, mode_cmd->handles[0]);
> > > + if (!obj) {
> > > + DRM_DEBUG_KMS("Failed to lookup GEM object\n");
> > > + return -ENOENT;
> > > + }
> > > +
> > > + switch (fb->modifier & AFBC_FORMAT_MOD_BLOCK_SIZE_MASK) {
> > > + case AFBC_FORMAT_MOD_BLOCK_SIZE_32x8:
> > > + alignment_w = 32;
> > > + alignment_h = 8;
> > > + break;
> > > + case AFBC_FORMAT_MOD_BLOCK_SIZE_16x16:
> > > + alignment_w = 16;
> > > + alignment_h = 16;
> > > + break;
> > > + default:
> > Can we have something like a warn here ?
>
> will add a WARN here.
>
I think it's better not to. fb->modifier comes from
userspace, so a malicious app could spam us with WARNs, effectively
dos-ing the system. -EINVAL should be sufficient.
Thanks,
-Brian
Powered by blists - more mailing lists