From: "Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: Boris Brezillon
<boris.brezillon-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Cc: Sandy Huang <hjc-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Douglas Anderson
<dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
Ezequiel Garcia
<ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Subject: Re: [RFC/WIP] drm/rockchip: Support CRTC gamma LUT
Date: Fri, 14 Jun 2019 16:03:28 +0200 [thread overview]
Message-ID: <4034618.A4UzVy7svI@diego> (raw)
In-Reply-To: <20190614155320.348d42af-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Hi Boris,
Am Freitag, 14. Juni 2019, 15:53:20 CEST schrieb Boris Brezillon:
> On Thu, 13 Jun 2019 16:22:44 -0300
> Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote:
>
>
> > +static int vop_gamma_lut_request(struct device *dev,
> > + struct resource *res, struct vop *vop)
> > +{
> > + resource_size_t offset = vop->data->gamma_lut_addr_off;
> > + resource_size_t size = VOP_GAMMA_LUT_SIZE * 4;
> > +
> > + /*
> > + * Some SoCs (e.g. RK3288) have the gamma LUT address after
> > + * the MMU registers, which means we can't request and ioremap
> > + * the entire register set. Other (e.g. RK3399) have gamma LUT
> > + * address before MMU.
> > + *
> > + * Therefore, we need to request and ioremap those that haven't
> > + * been already.
> > + */
> > + if (vop->len >= (offset + size)) {
> > + vop->lut_regs = vop->regs + offset;
> > + return 0;
> > + }
> > +
> > + if (!devm_request_mem_region(dev, res->start + offset,
> > + size, dev_name(dev))) {
> > + dev_warn(dev, "can't request gamma lut region\n");
> > + return -EBUSY;
> > + }
> > +
> > + vop->lut_regs = devm_ioremap(dev, res->start + offset, size);
> > + if (!vop->lut_regs) {
> > + dev_err(dev, "can't ioremap gamma lut address\n");
> > + devm_release_mem_region(dev, res->start + offset, size);
> > + return -ENOMEM;
> > + }
>
> Can't we patch the resource just after calling plaform_get_resource()
> (and before calling devm_ioremap_resource()) so we don't have to add
> these devm_request_mem_region()+devm_ioremap() calls here?
The issue is that on the older rk3288 socs the vops memory map has
the mmu registers (which get mapped separately) in between the core
and lut registers.
next prev parent reply other threads:[~2019-06-14 14:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 19:22 [RFC/WIP] drm/rockchip: Support CRTC gamma LUT Ezequiel Garcia
2019-06-13 19:36 ` Ilia Mirkin
2019-06-18 13:36 ` Ezequiel Garcia
2019-06-18 16:57 ` Ilia Mirkin
2019-06-14 13:53 ` Boris Brezillon
[not found] ` <20190614155320.348d42af-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-14 14:03 ` Heiko Stübner [this message]
2019-06-14 14:08 ` Boris Brezillon
2019-06-14 20:05 ` Doug Anderson
2019-06-18 13:38 ` Ezequiel Garcia
2019-06-17 10:06 ` Jacopo Mondi
2019-06-18 5:15 ` Ezequiel Garcia
2019-06-18 18:37 ` Ezequiel Garcia
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=4034618.A4UzVy7svI@diego \
--to=heiko-4mtyjxux2i+zqb+pc5nmwq@public.gmane.org \
--cc=boris.brezillon-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=hjc-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/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