From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Cheng, Yao" <yao.cheng@intel.com>
Cc: "Rao, Ram R" <ram.r.rao@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Jiang, Fei" <fei.jiang@intel.com>,
"Abel, Michael J" <michael.j.abel@intel.com>,
"Vetter, Daniel" <daniel.vetter@intel.com>
Subject: Re: [RFC PATCH v2 1/4] drm/i915: add i915_ved.c to setup bridge for VED
Date: Wed, 22 Oct 2014 10:49:44 +0300 [thread overview]
Message-ID: <20141022074944.GT4284@intel.com> (raw)
In-Reply-To: <8FF7D634BEE4C2428EFFAB6B7E919E4B017D967D@shsmsx102.ccr.corp.intel.com>
On Wed, Oct 22, 2014 at 07:09:11AM +0000, Cheng, Yao wrote:
> > -----Original Message-----
> > From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> > Sent: Tuesday, October 21, 2014 6:30 PM
> > To: Cheng, Yao
> > Cc: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; Kelley,
> > Sean V; Vetter, Daniel; Abel, Michael J; Jiang, Fei; Rao, Ram R
> > Subject: Re: [Intel-gfx] [RFC PATCH v2 1/4] drm/i915: add i915_ved.c to setup
> > bridge for VED
> >
> > On Tue, Oct 21, 2014 at 02:36:41PM +0800, Yao Cheng wrote:
<snip>
> >
> > > /* Call regardless, as some status bits might not be
> > > * signalled in iir */
> > > valleyview_pipestat_irq_handler(dev, iir); diff --git
> > > a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > > index 2ed02c3..95421ef 100644
> > > --- a/drivers/gpu/drm/i915/i915_reg.h
> > > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > > @@ -1284,6 +1284,11 @@ enum punit_power_well { #define
> > > VLV_DISPLAY_BASE 0x180000 #define VLV_MIPI_BASE
> > VLV_DISPLAY_BASE
> > >
> > > +/* forwarding VED irq and sharing MMIO to the VED driver */
> > > +#define VLV_VED_BLOCK_INTERRUPT (1 << 23)
> >
> > This define should be alongside the other IxR bits.
>
> Do you mean like this:
> Rename it to VLV_VED_IRQ and put alongside VLV_IIR?
No, I think the name is fine as is, but it should be where the other "old"
IxR bits are defined. So between I915_PM_INTERRUPT and I915_ISP_INTERRUPT
looks like right spot to me.
I'm not sure why those defines are where they are. We should probably
move the lot to sit next to the IxR register defines themselves, but
that's a separate issue.
<snip>
> >
> > > + if (!rsc) {
> > > + DRM_ERROR("Failed to allocate resource for VED platform
> > device\n");
> > > + ret = -ENOMEM;
> > > + goto err;
> > > + }
> > > +
> > > + WARN_ON(dev_priv->ved_irq < 0);
> > > + rsc[0].start = rsc[0].end = dev_priv->ved_irq;
> > > + rsc[0].flags = IORESOURCE_IRQ;
> > > + rsc[0].name = "ipvr-ved-vlv-irq";
> > > +
> > > + /* MMIO/REG for child's use */
> > > + rsc[1].start = pci_resource_start(dev->pdev, 0);
> > > + rsc[1].end = pci_resource_start(dev->pdev, 0) + 2*1024*1024; /*
> > gen7 */
> > > + rsc[1].flags = IORESOURCE_MEM;
> > > + rsc[1].name = "ipvr-ved-vlv-mmio";
> > > +
> > > + rsc[2].start = VLV_VED_BASE;
> > > + rsc[2].end = VLV_VED_BASE + VLV_VED_SIZE;
> > > + rsc[2].flags = IORESOURCE_REG;
> > > + rsc[2].name = "ipvr-ved-vlv-reg";
> >
> > I don't see why you need both MEM and REG resources. Just the MEM itself
> > should suffice:
> >
> > rsc[1].start = pci_resource_start(dev->pdev, 0) + VLV_VED_BASE;
> > rsc[1].end = pci_resource_start(dev->pdev, 0) + VLV_VED_BASE +
> > VLV_VED_SIZE;
> > rsc[1].flags = IORESOURCE_MEM;
> > rsc[1].name = "ipvr-ved-vlv-mmio";
> >
>
> When I write the original code on k3.10 I always got ioremap conflict by binding only one MMIO resource.
> I just tested this on k3.17 and no conflict. :) thanks for pointing out this and I will update the code.
> BTW, it's interesting, is there any update on the ioremap code from 3.10 to 3.17?
Not sure. But the UC vs. WC could be one explanation for the conflict.
>
> > Also in the ved driver you're mapping it with ioremap_wc() which isn't
> > generally safe to do with registers. I'm not sure the kernel would even allow
> > it since i915 has already mapped it as UC.
>
> Thanks, I'll change it to UC.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2014-10-22 7:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 6:36 [RFC PATCH v2 0/4] drm driver for VED in Intel GPU Yao Cheng
2014-10-21 6:36 ` [RFC PATCH v2 1/4] drm/i915: add i915_ved.c to setup bridge for VED Yao Cheng
2014-10-21 10:29 ` Ville Syrjälä
2014-10-22 7:09 ` Cheng, Yao
2014-10-22 7:49 ` Ville Syrjälä [this message]
2014-10-23 14:38 ` [Intel-gfx] " Cheng, Yao
2014-10-21 12:09 ` Daniel Vetter
2014-10-22 7:11 ` Cheng, Yao
2014-10-22 8:43 ` [Intel-gfx] " Daniel Vetter
2014-10-23 6:50 ` Cheng, Yao
2014-10-21 6:36 ` [RFC PATCH v2 2/4] drm/ipvr: drm driver " Yao Cheng
2014-10-21 9:08 ` Daniel Vetter
2014-10-22 6:37 ` Cheng, Yao
2014-10-22 8:50 ` Daniel Vetter
2014-10-23 6:59 ` Cheng, Yao
2014-10-23 14:45 ` [Intel-gfx] " Cheng, Yao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141022074944.GT4284@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=fei.jiang@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michael.j.abel@intel.com \
--cc=ram.r.rao@intel.com \
--cc=yao.cheng@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox