mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	David Airlie <airlied@linux.ie>,
	Kevin Hilman <khilman@baylibre.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Sekhar Nori <nsekhar@ti.com>, LKML <linux-kernel@vger.kernel.org>,
	linux-drm <dri-devel@lists.freedesktop.org>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	arm-soc <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v5 1/2] drm: tilcdc: implement palette loading for rev1
Date: Wed, 16 Nov 2016 16:40:32 +0200	[thread overview]
Message-ID: <e4027eb5-0d04-2536-49d3-77dd419ec81e@ti.com> (raw)
In-Reply-To: <CAMpxmJUh8KypU_-HtGa+ieCpO46FBME8_VQCJvYkCjFhmuVWgg@mail.gmail.com>

On 11/16/16 13:34, Bartosz Golaszewski wrote:
> 2016-10-31 17:05 GMT+01:00 Jyri Sarha <jsarha@ti.com>:
>> On 10/31/16 16:19, Bartosz Golaszewski wrote:
>>> Revision 1 of the IP doesn't work if we don't load the palette (even
>>> if it's not used, which is the case for the RGB565 format).
>>>
>>> Add a function called from tilcdc_crtc_enable() which performs all
>>> required actions if we're dealing with a rev1 chip.
>>>
>>
>> There is only one thing I do not like about this patch. The palette
>> loading is done so late that the frame buffer address are already placed
>> into DMA base and ceiling registers, and we need to read them from the
>> registers and restore them back after the palette loading.
>>
>> Could you try if the palette loading function works without trouble when
>> called from tilcdc_pm_resume() before drm_atomic_helper_resume() call?
>> If it does it would be cleaner in the sense that you could get rid off
>> the old dma address restore code. You could reinit the completion always
>> there right before the palette loading.
>>
>> If you can not get the above suggestion to work, then I can take this
>> patch.
>>
> 
> Hi Jyri,
> 
> the problem is that tilcdc_pm_resume() is not called when tilcdc is
> initialized. We would have to have two calls in different places for
> that to work.
> 

Yep, I know now. I worked on the issue while you were on vacation.
Please review my latest patch series (including this patch) and more
importantly test if the palette loading still works on rev 1 LCDC.

>>> +static void tilcdc_crtc_load_palette(struct drm_crtc *crtc)
>>> +{
>>> +     u32 dma_fb_base, dma_fb_ceiling, raster_ctl;
>>> +     struct tilcdc_crtc *tilcdc_crtc;
>>> +     struct drm_device *dev;
>>> +     u16 *first_entry;
>>> +
>>> +     dev = crtc->dev;
>>> +     tilcdc_crtc = to_tilcdc_crtc(crtc);
>>> +     first_entry = tilcdc_crtc->palette_base;
>>> +
>>> +     *first_entry = TILCDC_REV1_PALETTE_FIRST_ENTRY;
>>> +
>>> +     dma_fb_base = tilcdc_read(dev, LCDC_DMA_FB_BASE_ADDR_0_REG);
>>> +     dma_fb_ceiling = tilcdc_read(dev, LCDC_DMA_FB_CEILING_ADDR_0_REG);
>>> +     raster_ctl = tilcdc_read(dev, LCDC_RASTER_CTRL_REG);
>>> +
>>> +     /* Tell the LCDC where the palette is located. */
>>> +     tilcdc_write(dev, LCDC_DMA_FB_BASE_ADDR_0_REG,
>>> +                  tilcdc_crtc->palette_dma_handle);
>>> +     tilcdc_write(dev, LCDC_DMA_FB_CEILING_ADDR_0_REG,
>>> +                  (u32)tilcdc_crtc->palette_dma_handle
>>
>> Just a nit pick, but I would put the plus sign to the end of the line
>> above instead of the beginning of the line bellow. However,
>> check_patch.pl does not complain about this so I guess I can accept it too.
>>
>>> +                             + TILCDC_REV1_PALETTE_SIZE - 1);
>>> +
> 
> I'll fix that in v6.
> 
> Thanks,
> Bartosz Golaszewski
> 

  reply	other threads:[~2016-11-16 14:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 14:19 [PATCH v5 0/2] drm: tilcdc: improved support " Bartosz Golaszewski
2016-10-31 14:19 ` [PATCH v5 1/2] drm: tilcdc: implement palette loading " Bartosz Golaszewski
2016-10-31 16:05   ` Jyri Sarha
2016-11-16 11:34     ` Bartosz Golaszewski
2016-11-16 14:40       ` Jyri Sarha [this message]
2016-10-31 14:19 ` [PATCH v5 2/2] drm: tilcdc: clear the sync lost bit in crtc isr Bartosz Golaszewski
2016-10-31 16:32   ` Karl Beldan
2016-11-01 14:22   ` Jyri Sarha
2016-11-01 14:25   ` Jyri Sarha

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=e4027eb5-0d04-2536-49d3-77dd419ec81e@ti.com \
    --to=jsarha@ti.com \
    --cc=airlied@linux.ie \
    --cc=bgolaszewski@baylibre.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=khilman@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tomi.valkeinen@ti.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

all inboxes | Powered by JetHome®