From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Packard Subject: Re: [PATCH] drm/i915: add GPU max frequency control file Date: Wed, 27 Jul 2011 11:51:28 -0700 Message-ID: References: <1311789208-2494-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0776575291==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 84FFE9E79C for ; Wed, 27 Jul 2011 11:51:32 -0700 (PDT) In-Reply-To: <1311789208-2494-1-git-send-email-jbarnes@virtuousgeek.org> 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: Jesse Barnes , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0776575291== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Wed, 27 Jul 2011 10:53:28 -0700, Jesse Barnes = wrote: > + len =3D snprintf(buf, sizeof (buf), > + "freq: %d\n", dev_priv->max_delay * 50); should probably be 'Max frequency' too? > + > + if (len > sizeof (buf)) > + len =3D sizeof (buf); > + > + return simple_read_from_buffer(ubuf, max, ppos, buf, len); > +} > + > +static ssize_t > +i915_max_freq_write(struct file *filp, > + const char __user *ubuf, > + size_t cnt, > + loff_t *ppos) > +{ > + struct drm_device *dev =3D filp->private_data; > + struct drm_i915_private *dev_priv =3D dev->dev_private; > + char buf[20]; > + int val =3D 1; > + > + if (cnt > 0) { > + if (cnt > sizeof (buf) - 1) > + return -EINVAL; > + > + if (copy_from_user(buf, ubuf, cnt)) > + return -EFAULT; > + buf[cnt] =3D 0; > + > + val =3D simple_strtoul(buf, NULL, 0); > + } > + > + DRM_DEBUG_DRIVER("Manually setting freq to %d\n", val); And 'max freq' here too. Otherwise, this seems useful to me too. =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFOMF4xQp8BWwlsTdMRAj26AJ9W6YSIO9GgbQzeh6v083LZ2WyZmACZAcVz /skAqrnkvH5O9PgX22eKABA= =MXLY -----END PGP SIGNATURE----- --=-=-=-- --===============0776575291== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0776575291==--