From: Stefan Wahren <info-saaNCTdWVBT7BZbvpMY5sg@public.gmane.org>
To: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v3 3/7] drm/vc4: Add KMS support for Raspberry Pi.
Date: Tue, 13 Oct 2015 20:50:30 +0200 [thread overview]
Message-ID: <561D5276.40906@lategoodbye.de> (raw)
In-Reply-To: <87io6a3a34.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
Am 13.10.2015 um 20:19 schrieb Eric Anholt:
> Stefan Wahren <info-saaNCTdWVBT7BZbvpMY5sg@public.gmane.org> writes:
>
>>> diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig
>>> new file mode 100644
>>> index 0000000..e810ef7
>>> --- /dev/null
>>> +++ b/drivers/gpu/drm/vc4/Kconfig
>>> @@ -0,0 +1,13 @@
>>> +config DRM_VC4
>>> + tristate "Broadcom VC4 Graphics"
>>> + depends on ARCH_BCM2835
>>
>> depends on (ARCH_BCM2835 || COMPILE_TEST) ?
>
> Done.
Sorry for the bad suggestion. The parentheses should be necessary.
>
>>> + depends on DRM
>>> + select DRM_KMS_HELPER
>>> + select DRM_KMS_CMA_HELPER
>>> + help
>>> + Choose this option if you have a system that has a Broadcom
>>> + VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
>>> +
>>> + This driver requires that "avoid_warnings=2" be present in
>>> + the config.txt for the firmware, to keep it from smashing
>>> + our display setup.
>>> + [...]
>>> +static void vc4_crtc_disable(struct drm_crtc *crtc)
>>> +{
>>> + struct drm_device *dev = crtc->dev;
>>> + struct vc4_dev *vc4 = to_vc4_dev(dev);
>>> + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
>>> + u32 chan = vc4_crtc->channel;
>>> +
>>> + require_hvs_enabled(dev);
>>> +
>>> + CRTC_WRITE(PV_V_CONTROL,
>>> + CRTC_READ(PV_V_CONTROL) & ~PV_VCONTROL_VIDEN);
>>> + while (CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_VIDEN)
>>> + cpu_relax();
>>> +
>>> + /* Without a wait here, we end up with a black screen. */
>>> + msleep(30);
>>
>> This looks a little bit strange. First we do a busy loop without any
>> timeout and then a fixed msleep without reason for the exact duration.
>>
>> Sorry for the possibly dumb questions:
>>
>> Is it safe to read PV_V_CONTROL exactly after writing to them? No
>> sleeping required?
>
> Correct. We're waiting for the value to land, so you just read until it
> does.
The reason for my question was the possibility that writing to
PV_V_CONTROL could take some time and reading directly after writing
could return the old value. In such a case the busy loop has no effect.
But if it is not the case here everything is fine :-)
>
> I've pulled in a later change for doing waits with timouts.
>
>> How did you come to the 30 milli seconds?
>
> a bit more than a frame. The comment was there to document why the
> sleep was there. It looks like in retesting now that it's not required.
Sounds better
Regards
Stefan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-10-13 18:50 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 21:27 bcm2835 (Raspberry Pi) KMS driver Eric Anholt
2015-10-09 21:27 ` [PATCH v3 1/7] drm/vc4: Add devicetree bindings for VC4 Eric Anholt
[not found] ` <1444426068-15817-2-git-send-email-eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2015-10-09 23:31 ` Sebastian Reichel
2015-10-13 17:59 ` Eric Anholt
2015-10-13 13:26 ` Rob Herring
2015-10-13 18:17 ` Eric Anholt
2015-10-13 21:56 ` Rob Herring
2015-10-21 8:57 ` Eric Anholt
2015-10-21 22:08 ` Rob Herring
2015-10-09 21:27 ` [PATCH v3 2/7] MAINTAINERS: Add myself for the new VC4 (RPi GPU) graphics driver Eric Anholt
2015-10-09 22:12 ` Emil Velikov
2015-10-09 23:13 ` Eric Anholt
2015-10-09 21:27 ` [PATCH v3 3/7] drm/vc4: Add KMS support for Raspberry Pi Eric Anholt
[not found] ` <1444426068-15817-4-git-send-email-eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2015-10-11 14:02 ` Stefan Wahren
2015-10-13 18:19 ` Eric Anholt
[not found] ` <87io6a3a34.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
2015-10-13 18:50 ` Stefan Wahren [this message]
2015-10-13 19:01 ` Stefan Wahren
2015-10-09 21:27 ` [PATCH v3 4/7] drm/vc4: Use the fbdev_cma helpers Eric Anholt
2015-10-09 21:27 ` [PATCH v3 5/7] drm/vc4: Allow vblank to be disabled Eric Anholt
2015-10-09 21:27 ` [PATCH v3 6/7] ARM: bcm2835: Add the DDC I2C controller to the device tree Eric Anholt
2015-10-09 21:27 ` [PATCH v3 7/7] ARM: bcm2835: Add VC4 " Eric Anholt
2015-10-11 14:23 ` Stefan Wahren
2015-10-12 20:57 ` Eric Anholt
[not found] ` <1444426068-15817-1-git-send-email-eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2015-10-11 12:39 ` bcm2835 (Raspberry Pi) KMS driver Stefan Wahren
[not found] ` <561A587D.6020009-saaNCTdWVBT7BZbvpMY5sg@public.gmane.org>
2015-10-12 20:39 ` Stephen Warren
2015-10-12 20:53 ` Eric Anholt
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=561D5276.40906@lategoodbye.de \
--to=info-saanctdwvbt7bzbvpmy5sg@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@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;
as well as URLs for NNTP newsgroup(s).