From: Damien Lespiau Subject: Re: [PATCH 2/3] drm/i915: Iterate through the initialized DDIs to prepare their buffers Date: Thu, 7 Aug 2014 15:22:20 +0100 Message-ID: <20140807142220.GA2751@strange.ger.corp.intel.com> References: <1407234579-16934-1-git-send-email-damien.lespiau@intel.com> <1407234579-16934-3-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id DBAEC6E79A for ; Thu, 7 Aug 2014 07:22:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Thu, Aug 07, 2014 at 11:17:35AM -0300, Paulo Zanoni wrote: > > +#define for_each_digital_port(dev, digital_port) \ > > + list_for_each_entry(digital_port, \ > > + &dev->mode_config.encoder_list, \ > > + base.base.head) > > We can't really assume that every encoder is intel_digital_port since > we still have the CRT encoder on HSW/BDW. > > And we can't run this code just for the dig_ports since CRT needs it too. Ah, missed that, of course... > > + for_each_digital_port(dev, intel_dig_port) { > > + if (visited[intel_dig_port->port]) > > + continue; > > + > > + intel_prepare_ddi_buffers(dev, intel_dig_port); > > + visited[intel_dig_port->port] = true; > > + } > > A comment on why we need the "visited" array is much appreciated, > because it appears to be useless for the code reader. Why is it here? > Will we ever have more than one encoder per port? Because of the MST "fake" encoder. -- Damien