From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Clamp cursor coordinates to int16_t range Date: Mon, 28 Oct 2013 18:01:09 +0100 Message-ID: <20131028170109.GR18189@phenom.ffwll.local> References: <1382371318-9250-1-git-send-email-ville.syrjala@linux.intel.com> <20131021161343.GA6083@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E253E6EBC for ; Mon, 28 Oct 2013 10:00:43 -0700 (PDT) Received: by mail-ee0-f53.google.com with SMTP id e51so1592019eek.12 for ; Mon, 28 Oct 2013 10:00:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20131021161343.GA6083@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson , ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Oct 21, 2013 at 05:13:43PM +0100, Chris Wilson wrote: > On Mon, Oct 21, 2013 at 07:01:58PM +0300, ville.syrjala@linux.intel.com w= rote: > > From: Ville Syrj=E4l=E4 > > = > > We store cursor_x/y as int16_t internally, but the user provided > > coordinates are int32_t. Clamp the coordinates so that they don't > > overflow the int16_t. Since the cursor is only 64x64 in size, the > > clamping can't cause any visual changes. > = > EINVAL? That would appear to be a nuisance as we don't already tell the > user off for being silly with the cursor position. > = > Bump the internal range? Future proof against tomorrow's 64k > super-ultra-high definition monitors? > = > The valid range for cursor is currently (-64, 8192) and we don't compute > relative cursor position, so we will be fine for a few years yet with > int16_t. > = > > Signed-off-by: Ville Syrj=E4l=E4 > Reviewed-by: Chris Wilson Queued for -next, thanks for the patch. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch