From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Mickler Subject: Re: [PATCH 1/7 resend] drm/i915: Add the support of eDP on DP-D for Ibex/CPT Date: Mon, 14 Jun 2010 10:21:03 +0200 Message-ID: <20100614102103.2ed9ee9c@schatten.dmk.lab> References: <1276324347-15668-1-git-send-email-zhenyuw@linux.intel.com> <1276324347-15668-2-git-send-email-zhenyuw@linux.intel.com> <89k83a$8inni8@azsmga001.ch.intel.com> <1276391192.4564.131.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx01.d-labs.de (ist.d-labs.de [213.239.218.44]) by gabe.freedesktop.org (Postfix) with ESMTP id BE0259E7BB for ; Mon, 14 Jun 2010 01:21:31 -0700 (PDT) In-Reply-To: <1276391192.4564.131.camel@localhost.localdomain> 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: ykzhao Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org On Sun, 13 Jun 2010 09:06:32 +0800 ykzhao wrote: > On Sat, 2010-06-12 at 16:28 +0800, Chris Wilson wrote: > > On Sat, 12 Jun 2010 14:32:21 +0800, Zhenyu Wang wrote: > > > From: Zhao Yakui > > > static void > > > -intel_dp_compute_m_n(int bytes_per_pixel, > > > +intel_dp_compute_m_n(int bpp, > > > int nlanes, > > > int pixel_clock, > > > int link_clock, > > > struct intel_dp_m_n *m_n) > > > { > > > m_n->tu = 64; > > > - m_n->gmch_m = pixel_clock * bytes_per_pixel; > > > + m_n->gmch_m = (pixel_clock * bpp) >> 3; > > > m_n->gmch_n = link_clock * nlanes; > > > intel_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); > > > m_n->link_m = pixel_clock; > > > > This rounds the gmch_m down. Is this correct? And how close to overflow > > is pixel_clock today? > > The bpp is the abbreviation of bits per pixel and this is not round > down. It is only to convert the bits per second to bytes per second, > which will be used to calculation the DP M/N . > You do a bitshift which ignores any fractional part. So, for example, if pixel_clock*bpp == 7 is true, the result of (pixel_clock*bpp)>>3 would be 0. Wouldn't it? So Chris' question if this is correct is still pending an answer. It may be correct, but how did you decide what to do there? Cheers, Flo