Re: [PATCH 05/27] drivers/gpu/host1x/drm: don't check resource with devm_ioremap_resource

2013-08-01 Thread Terje Bergström
On 23.07.2013 21:01, Wolfram Sang wrote: > diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c > index 01097da..9ffece6 100644 > --- a/drivers/gpu/host1x/drm/hdmi.c > +++ b/drivers/gpu/host1x/drm/hdmi.c > @@ -1248,9 +1248,6 @@ static int tegra_hdmi_probe(struct platform_devic

Re: [PATCH 4/5] ARM: tegra: Add host1x, dc and hdmi to Tegra114 device tree

2013-08-29 Thread Terje Bergström
On 28.08.2013 16:18, Thierry Reding wrote: > I think that's not all. I have local patches that also introduce a v2 of > host1x, because the number of syncpoints is different. There may also be > other differences, but Terje might be more qualified to answer that. Tegra4 host1x has an extra channel

[RFC] drm/nouveau: disable caching for VRAM BOs on ARM

2014-05-26 Thread Terje Bergström
On 23.05.2014 17:40, Alex Courbot wrote: > On 05/23/2014 06:59 PM, Lucas Stach wrote: > So after checking with more knowledgeable people, it turns out this is > the expected behavior on ARM and BAR regions should be mapped uncached > on GK20A. All the more reasons to avoid using the BAR at all.

[PATCH 4/5] ARM: tegra: Add host1x, dc and hdmi to Tegra114 device tree

2013-08-29 Thread Terje Bergström
On 28.08.2013 16:18, Thierry Reding wrote: > I think that's not all. I have local patches that also introduce a v2 of > host1x, because the number of syncpoints is different. There may also be > other differences, but Terje might be more qualified to answer that. Tegra4 host1x has an extra channel

[PATCH] drm: tegra: Use framebuffer pitch as line stride

2012-11-23 Thread Terje Bergström
On 22.11.2012 21:37, Thierry Reding wrote: > Instead of using the stride derived from the display mode, use the pitch > associated with the currently active framebuffer. This fixes a bug where > the LCD display content would be skewed when enabling HDMI with a video > mode different from that of th

[PATCH] drm: tegra: Use framebuffer pitch as line stride

2012-11-23 Thread Terje Bergström
On 22.11.2012 21:37, Thierry Reding wrote: > Instead of using the stride derived from the display mode, use the pitch > associated with the currently active framebuffer. This fixes a bug where > the LCD display content would be skewed when enabling HDMI with a video > mode different from that of th

[RFC v2 5/8] ARM: tegra: Add auxiliary data for nvhost

2012-11-27 Thread Terje Bergström
On 27.11.2012 01:39, Stephen Warren wrote: > Clock names shouldn't be passed in platform data; instead, clk_get() > should be passed the device object and device-relative (i.e. not global) > clock name. I expect if the driver is fixed to make this change, the > changes to tegra*_clocks_data.c won't

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 00:15, Dave Airlie wrote: >> static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) >> { >> - return 0; >> + struct tegra_drm_fpriv *fpriv; >> + int err = 0; >> + >> + fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); >> + if (!fpriv) >> +

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 09:33, Dave Airlie wrote: >> Third would be having a firewall in 2D driver checking the stream and >> ensuring all registers that accept addresses are written by values >> derived from dmabufs. I haven't tried implementing this, but it'd >> involve a lookup table in kernel and CPU rea

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 10:32, Dave Airlie wrote: > On Tue, Nov 27, 2012 at 8:16 AM, Terje Bergstr?m > wrote: >> Thanks for the pointer, I looked at exynos code. It indeed checks the >> registers written to, but it doesn't prevent overrun by checking sizes >> of buffers and compare against requests. > They

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 12:37, Thierry Reding wrote: > But in that case it should be made mandatory at first until proper IOMMU > support is enabled on Tegra30. Then it can be checked at driver probe > time whether or not to enable the extra checks. That way we don't need a > special Kconfig option and we st

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 13:47, Lucas Stach wrote: > I guess we could change IOMMU address spaces for the graphics units > depending on the active channel. This would still be a bit of a > performance hit, because of the necessary TLB flushing and so on, but > should be much better than checking the whole com

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 01:00, Dave Airlie wrote: > We generally aim for the first, to stop the gpu from reading/writing > any memory it hasn't been granted access to, > the second is nice to have though, but really requires a GPU with VM > to implement properly. I wonder if we should aim at root only acce

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 15:33, Lucas Stach wrote: > So this is obviously wrong. Userspace has to allocate a pushbuffer from > the kernel just as every other buffer, then map it into it's own address > space to push in commands. At submit time of the pushbuf kernel has to > make sure that userspace is not abl

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 16:06, Lucas Stach wrote: > Why do even need/use dma-buf for this use case? This is all one DRM > device, even if we separate host1x and gr2d as implementation modules. I didn't want to implement dependency to drm gem objects in nvhost, but we have thought about doing that. dma-buf b

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 17:13, Lucas Stach wrote: > To be honest I still don't grok all of this, but nonetheless I try my > best. Sorry. I promised in another thread a write-up explaining the design. I still owe you guys that. > Anyway, shouldn't nvhost be something like an allocator used by host1x > clien

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-29 Thread Terje Bergström
On 28.11.2012 20:46, Lucas Stach wrote: > Am Mittwoch, den 28.11.2012, 18:23 +0200 schrieb Terje Bergstr?m: >> Sorry. I promised in another thread a write-up explaining the design. I >> still owe you guys that. > That would be really nice to have. I'm also particularly interested in > how you plan

[RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-29 Thread Terje Bergström
On 28.11.2012 23:23, Thierry Reding wrote: > This could be problematic. Since drivers/video and drivers/gpu/drm are > separate trees, this would entail a continuous burden on keeping both > trees synchronized. While I realize that eventually it might be better > to put the host1x driver in a separa

[RFC v2 2/8] video: tegra: Add syncpoint wait and interrupts

2012-11-29 Thread Terje Bergström
On 29.11.2012 10:44, Thierry Reding wrote: >> diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c >> index 98c9c9f..025a820 100644 >> --- a/drivers/video/tegra/host/dev.c >> +++ b/drivers/video/tegra/host/dev.c >> @@ -43,6 +43,13 @@ u32 host1x_syncpt_read(u32 id) >> } >>

[RFC,v2,3/8] video: tegra: host: Add channel and client support

2012-11-29 Thread Terje Bergström
On 29.11.2012 12:01, Mark Zhang wrote: >> +fail: >> +/* Add clean-up */ > > Yes, add "nvhost_module_deinit" here? Sounds good. >> +int nvhost_client_device_suspend(struct platform_device *dev) >> +{ >> +int ret = 0; >> +struct nvhost_device_data *pdata = platform_get_drvdata(dev); >>

[RFC v2 3/8] video: tegra: host: Add channel and client support

2012-11-29 Thread Terje Bergström
On 29.11.2012 12:04, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Mon, Nov 26, 2012 at 03:19:09PM +0200, Terje Bergstrom wrote: > > I've skipped a lot of code here that I need more time to review. Thanks already for the very good comments! It's great getting comments on the code

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-29 Thread Terje Bergström
On 29.11.2012 11:09, Lucas Stach wrote: > We should aim for a clean split here. GEM handles are something which is > really specific to how DRM works and as such should be constructed by > tegradrm. nvhost should really just manage allocations/virtual address > space and provide something that is a

[RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-30 Thread Terje Bergström
On 29.11.2012 20:34, Stephen Warren wrote: > On 11/29/2012 03:21 AM, Terje Bergstr?m wrote: >> True. I might also as well delete the general interrupt altogether, as >> we don't use it for any real purpose. > > Do make sure the interrupts still are part of the DT binding though, so > that the bind

[RFC v2 2/8] video: tegra: Add syncpoint wait and interrupts

2012-11-30 Thread Terje Bergström
Just replying to part of your mail. On 30.11.2012 09:22, Thierry Reding wrote: > Actually for the display controller we want just a notification when the > VBLANK happens. I'm not sure if we want to do that with syncpoints at > all since it works quite well using regular interrupts. VBLANK isn't

[RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-30 Thread Terje Bergström
On 29.11.2012 14:14, Thierry Reding wrote: > On Thu, Nov 29, 2012 at 10:09:13AM +0100, Lucas Stach wrote: >> This way you would also be able to construct different handles (like GEM >> obj or V4L2 buffers) from the same backing nvhost object. Note that I'm >> not sure how useful this would be, but

[RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-30 Thread Terje Bergström
On 29.11.2012 13:47, Thierry Reding wrote: > On Thu, Nov 29, 2012 at 12:21:04PM +0200, Terje Bergstr?m wrote: >> Tegra20 and Tegra30 are compatible, but future chips are not. I was >> hoping we would be ready in upstream kernel for future chips. > > I think we should ignore that problem for now. G

Re: [PATCH v3 0/2] NVIDIA Tegra DRM driver

2012-11-16 Thread Terje Bergström
On 15.11.2012 23:28, Thierry Reding wrote: > This third version of the patch series cleans up some minor issues that > were found in the previous versions, such as deferred probe not working > properly and the display remaining enabled after the driver is removed. > > I've also put the two patches

Re: [PATCH] drm: tegra: Use framebuffer pitch as line stride

2012-11-22 Thread Terje Bergström
On 22.11.2012 21:37, Thierry Reding wrote: > Instead of using the stride derived from the display mode, use the pitch > associated with the currently active framebuffer. This fixes a bug where > the LCD display content would be skewed when enabling HDMI with a video > mode different from that of th

Re: [PATCH] drm: tegra: Use framebuffer pitch as line stride

2012-11-23 Thread Terje Bergström
On 22.11.2012 21:37, Thierry Reding wrote: > Instead of using the stride derived from the display mode, use the pitch > associated with the currently active framebuffer. This fixes a bug where > the LCD display content would be skewed when enabling HDMI with a video > mode different from that of th

Re: [RFC v2 5/8] ARM: tegra: Add auxiliary data for nvhost

2012-11-26 Thread Terje Bergström
On 27.11.2012 01:39, Stephen Warren wrote: > Clock names shouldn't be passed in platform data; instead, clk_get() > should be passed the device object and device-relative (i.e. not global) > clock name. I expect if the driver is fixed to make this change, the > changes to tegra*_clocks_data.c won't

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-26 Thread Terje Bergström
On 27.11.2012 00:15, Dave Airlie wrote: >> static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp) >> { >> - return 0; >> + struct tegra_drm_fpriv *fpriv; >> + int err = 0; >> + >> + fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); >> + if (!fpriv) >> +

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 09:33, Dave Airlie wrote: >> Third would be having a firewall in 2D driver checking the stream and >> ensuring all registers that accept addresses are written by values >> derived from dmabufs. I haven't tried implementing this, but it'd >> involve a lookup table in kernel and CPU rea

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 10:32, Dave Airlie wrote: > On Tue, Nov 27, 2012 at 8:16 AM, Terje Bergström > wrote: >> Thanks for the pointer, I looked at exynos code. It indeed checks the >> registers written to, but it doesn't prevent overrun by checking sizes >> of buffers

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 12:37, Thierry Reding wrote: > But in that case it should be made mandatory at first until proper IOMMU > support is enabled on Tegra30. Then it can be checked at driver probe > time whether or not to enable the extra checks. That way we don't need a > special Kconfig option and we st

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-27 Thread Terje Bergström
On 27.11.2012 13:47, Lucas Stach wrote: > I guess we could change IOMMU address spaces for the graphics units > depending on the active channel. This would still be a bit of a > performance hit, because of the necessary TLB flushing and so on, but > should be much better than checking the whole com

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 01:00, Dave Airlie wrote: > We generally aim for the first, to stop the gpu from reading/writing > any memory it hasn't been granted access to, > the second is nice to have though, but really requires a GPU with VM > to implement properly. I wonder if we should aim at root only acce

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 15:33, Lucas Stach wrote: > So this is obviously wrong. Userspace has to allocate a pushbuffer from > the kernel just as every other buffer, then map it into it's own address > space to push in commands. At submit time of the pushbuf kernel has to > make sure that userspace is not abl

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 16:06, Lucas Stach wrote: > Why do even need/use dma-buf for this use case? This is all one DRM > device, even if we separate host1x and gr2d as implementation modules. I didn't want to implement dependency to drm gem objects in nvhost, but we have thought about doing that. dma-buf b

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-28 Thread Terje Bergström
On 28.11.2012 17:13, Lucas Stach wrote: > To be honest I still don't grok all of this, but nonetheless I try my > best. Sorry. I promised in another thread a write-up explaining the design. I still owe you guys that. > Anyway, shouldn't nvhost be something like an allocator used by host1x > clien

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-29 Thread Terje Bergström
On 28.11.2012 20:46, Lucas Stach wrote: > Am Mittwoch, den 28.11.2012, 18:23 +0200 schrieb Terje Bergström: >> Sorry. I promised in another thread a write-up explaining the design. I >> still owe you guys that. > That would be really nice to have. I'm also particularly inter

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-29 Thread Terje Bergström
On 28.11.2012 23:23, Thierry Reding wrote: > This could be problematic. Since drivers/video and drivers/gpu/drm are > separate trees, this would entail a continuous burden on keeping both > trees synchronized. While I realize that eventually it might be better > to put the host1x driver in a separa

Re: [RFC v2 2/8] video: tegra: Add syncpoint wait and interrupts

2012-11-29 Thread Terje Bergström
On 29.11.2012 10:44, Thierry Reding wrote: >> diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c >> index 98c9c9f..025a820 100644 >> --- a/drivers/video/tegra/host/dev.c >> +++ b/drivers/video/tegra/host/dev.c >> @@ -43,6 +43,13 @@ u32 host1x_syncpt_read(u32 id) >> } >>

Re: [RFC,v2,3/8] video: tegra: host: Add channel and client support

2012-11-29 Thread Terje Bergström
On 29.11.2012 12:01, Mark Zhang wrote: >> +fail: >> +/* Add clean-up */ > > Yes, add "nvhost_module_deinit" here? Sounds good. >> +int nvhost_client_device_suspend(struct platform_device *dev) >> +{ >> +int ret = 0; >> +struct nvhost_device_data *pdata = platform_get_drvdata(dev); >>

Re: [RFC v2 3/8] video: tegra: host: Add channel and client support

2012-11-29 Thread Terje Bergström
On 29.11.2012 12:04, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Mon, Nov 26, 2012 at 03:19:09PM +0200, Terje Bergstrom wrote: > > I've skipped a lot of code here that I need more time to review. Thanks already for the very good comments! It's great getting comments on the code

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-29 Thread Terje Bergström
On 29.11.2012 11:09, Lucas Stach wrote: > We should aim for a clean split here. GEM handles are something which is > really specific to how DRM works and as such should be constructed by > tegradrm. nvhost should really just manage allocations/virtual address > space and provide something that is a

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-30 Thread Terje Bergström
On 29.11.2012 20:34, Stephen Warren wrote: > On 11/29/2012 03:21 AM, Terje Bergström wrote: >> True. I might also as well delete the general interrupt altogether, as >> we don't use it for any real purpose. > > Do make sure the interrupts still are part of the DT bin

Re: [RFC v2 2/8] video: tegra: Add syncpoint wait and interrupts

2012-11-30 Thread Terje Bergström
Just replying to part of your mail. On 30.11.2012 09:22, Thierry Reding wrote: > Actually for the display controller we want just a notification when the > VBLANK happens. I'm not sure if we want to do that with syncpoints at > all since it works quite well using regular interrupts. VBLANK isn't

Re: [RFC v2 8/8] drm: tegra: Add gr2d device

2012-11-30 Thread Terje Bergström
On 29.11.2012 14:14, Thierry Reding wrote: > On Thu, Nov 29, 2012 at 10:09:13AM +0100, Lucas Stach wrote: >> This way you would also be able to construct different handles (like GEM >> obj or V4L2 buffers) from the same backing nvhost object. Note that I'm >> not sure how useful this would be, but

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-11-30 Thread Terje Bergström
On 29.11.2012 13:47, Thierry Reding wrote: > On Thu, Nov 29, 2012 at 12:21:04PM +0200, Terje Bergström wrote: >> Tegra20 and Tegra30 are compatible, but future chips are not. I was >> hoping we would be ready in upstream kernel for future chips. > > I think we should ignore

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 30.11.2012 12:38, Thierry Reding wrote: > * PGP Signed by an unknown key > The above implies that when you submit code it shouldn't contain pieces > that prepare for possible future extensions which may or may not be > submitted (the exception being if such changes are part of a series > where s

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 30.11.2012 10:50, Lucas Stach wrote: > I'm with Thierry here. I think there is a fair chance that we won't get > the API right from the start, even when trying to come up with something > that sounds sane to everyone. It's also not desirable to delay gr2d > going into mainline until we are all c

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 01.12.2012 15:42, Daniel Vetter wrote: > Out of sheer curiosity: What are you using the coverage data of these > register definitions for? When I looked into coverage analysis the > resulting data seemed rather useless to me, since the important thing > is how well we cover the entire dynamic st

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 01.12.2012 17:10, Thierry Reding wrote: > On Sat, Dec 01, 2012 at 01:44:41PM +0200, Terje Bergström wrote: >> host1x module being in DRM directory hinders using nvhost from anywhere >> outside DRM in both upstream and downstream. > > That's not true. Nothing keeps t

Re: [RFC v2 0/8] Support for Tegra 2D hardware

2012-12-01 Thread Terje Bergström
On 01.12.2012 16:45, Thierry Reding wrote: > I did some prototyping on how a libdrm API could look like a few weeks > back. I should clean the patches up some and push them to a public > repository or to the mailing lists for review. Ok. Sorry about the delay - I recently learned I need separate p

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 01.12.2012 16:58, Thierry Reding wrote: > I don't know where you see politics in what I said. All I'm saying is > that we shouldn't be making things needlessly complex. In my experience > the technically cleanest solution is usually the one with the least > complexity. Let me come up with a pro

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-01 Thread Terje Bergström
On 01.12.2012 19:34, Lucas Stach wrote: > This would certainly make life easier, but personally I don't think it's > the right thing to do. The separation of the Linux kernel into different > subsystems was done for a reason and just because the specific hardware > at hands happens to work a bit di

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-02 Thread Terje Bergström
On 01.12.2012 23:42, Dave Airlie wrote: > Guys I think you guys might be overthniking things here. > > I know you have some sort of upstream/downstream split, but really in > the upstream kernel, we don't care about that, so don't make it our > problem. I am not trying to make anything your probl

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-02 Thread Terje Bergström
On 02.12.2012 22:55, Thierry Reding wrote: > FWIW I'm convinced that you're genuinely trying to make this work and > nobody welcomes this more than me. However it is only natural if you > dump such a large body of code on the community that people will > disagree with some of the design decisions.

Re: [RFC v2 1/8] video: tegra: Add nvhost driver

2012-12-03 Thread Terje Bergström
On 03.12.2012 23:03, Thierry Reding wrote: > What's really difficult to follow is if an ops structure is accessed via > some global macro. It also breaks encapsulation because you have a > global ops structure. That may even work fine for now, but it will break > once you have more than a single ho

First version of host1x intro

2012-12-05 Thread Terje Bergström
Hi, I created a base for host1x introduction text, and pasted it into https://gitorious.org/linux-tegra-drm/pages/Host1xIntroduction. For convenience, I also copy it below. As I've worked with all of this for so long, I cannot know what areas are most interesting to you, so I just tried to put in

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-05 Thread Terje Bergström
On 05.12.2012 10:33, Thierry Reding wrote: > I've been thinking about this some more and came to the conclusion that > since we will already have a tight coupling between host1x and tegra-drm > we may just as well keep the client registration code in host1x. The way > I imagine this to work would b

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-05 Thread Terje Bergström
On 05.12.2012 13:13, Thierry Reding wrote: > What I propose is to move the client registration code that is currently > in drivers/gpu/drm/tegra/host1x.c to the host1x driver, which may or may > not end up in drivers/gpu/host1x. Ok. > >> host1x hardware access must be encapsulated in host1x driv

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-05 Thread Terje Bergström
On 05.12.2012 14:04, Thierry Reding wrote: > On Wed, Dec 05, 2012 at 01:47:38PM +0200, Terje Bergström wrote: > Yes, but there's more. For instance I went to great lengths to make sure > there's no global data whatsoever. So all the data is bound to the > host1x device in th

Re: First version of host1x intro

2012-12-06 Thread Terje Bergström
On 06.12.2012 09:06, Mark Zhang wrote: > Thank you for the doc. So here I have questions: > > Push buffer contains a lot of opcodes for this channel. So when multiple > userspace processes submit jobs to this channel, all these jobs will be > saved in the push buffer and return, right? I mean, nvh

Re: First version of host1x intro

2012-12-06 Thread Terje Bergström
On 07.12.2012 07:38, Mark Zhang wrote: > On 12/06/2012 07:36 PM, Terje Bergström wrote: >> This is about the hardware, and the correct verb is "copy". HOST1X >> hardware pre-fetches opcodes from push buffer and contents of GATHERs to >> a FIFO to overcome memory l

Re: [RFC,v2,1/8] video: tegra: Add nvhost driver

2012-12-10 Thread Terje Bergström
On 29.11.2012 11:10, Mark Zhang wrote: >> + >> +/** >> + * Write a cpu syncpoint increment to the hardware, without touching >> + * the cache. Caller is responsible for host being powered. >> + */ >> +static void host1x_syncpt_cpu_incr(struct nvhost_syncpt *sp, u32 id) >> +{ >> + struct nvhost_

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-10 Thread Terje Bergström
On 05.12.2012 14:04, Thierry Reding wrote: > On Wed, Dec 05, 2012 at 01:47:38PM +0200, Terje Bergström wrote: >> You're right in that binding to a sub-device is not a nice way. DRM >> framework just needs a "struct device" to bind to. exynos seems to solve >>

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-12 Thread Terje Bergström
On 12.12.2012 18:08, Thierry Reding wrote: > I've briefly discussed this with Stephen on IRC because I thought I had > remembered him objecting to the idea of adding a dummy device just for > this purpose. It turns out, however, that what he didn't like was to add > a dummy node to the DT just to m

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-13 Thread Terje Bergström
On 12.12.2012 18:08, Thierry Reding wrote: > I've briefly discussed this with Stephen on IRC because I thought I had > remembered him objecting to the idea of adding a dummy device just for > this purpose. It turns out, however, that what he didn't like was to add > a dummy node to the DT just to m

Re: [PATCHv3 0/7] Support for Tegra 2D hardware

2012-12-13 Thread Terje Bergström
On 13.12.2012 17:03, Lucas Stach wrote: > You are still doing the allocation the IMHO wrong way around. I thought > we agreed to do all the allocations in host1x, which obviously means not > using the cma_gem_helpers anymore, but introducing a new native host1x > object to back GEM/V4L/whatever obj

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-13 Thread Terje Bergström
On 13.12.2012 19:58, Stephen Warren wrote: > On 12/13/2012 01:57 AM, Thierry Reding wrote: >> After some more discussion with Stephen on IRC we came to the >> conclusion that the easiest might be to have tegra-drm call into >> host1x with something like: >> >> void host1x_set_drm_device(struct host

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-14 Thread Terje Bergström
On 14.12.2012 18:21, Stephen Warren wrote: > On 12/13/2012 11:09 PM, Terje Bergström wrote: >> They want to get the global data by getting drvdata of their parent. > > There's no reason that /has/ to be so; they can get any information from > wherever it is, rather than try

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-16 Thread Terje Bergström
On 16.12.2012 14:16, Thierry Reding wrote: > Okay, so we're back on the topic of using globals. I need to assert > again that this is not an option. If we were to use globals, then we > could just as well leave out the dummy device and just do all of that in > the tegra-drm driver's initialization

Re: [PATCHv3 4/7] gpu: host1x: Add debug support

2012-12-17 Thread Terje Bergström
On 13.12.2012 17:23, Joe Perches wrote: > On Thu, 2012-12-13 at 16:04 +0200, Terje Bergstrom wrote: >> Add support for host1x debugging. Adds debugfs entries, and dumps >> channel state to UART in case of stuck job. > > trivial note: > > [] > >> diff --git a/drivers/gpu/host1x/debug.h b/drivers/

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-17 Thread Terje Bergström
On 17.12.2012 22:55, Stephen Warren wrote: > On 12/16/2012 09:37 AM, Terje Bergström wrote: > ... >> ... Sure we could tell DC to ask its parent >> (host1x), and call host1x driver with platform_device pointer found that >> way, and host1x would return a pointer to tegr

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-20 Thread Terje Bergström
On 16.12.2012 14:16, Thierry Reding wrote: > Okay, so we're back on the topic of using globals. I need to assert > again that this is not an option. If we were to use globals, then we > could just as well leave out the dummy device and just do all of that in > the tegra-drm driver's initialization

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-20 Thread Terje Bergström
On 20.12.2012 19:14, Stephen Warren wrote: > I'm not sure that sounds right. drvdata is something that a driver > should manage itself. > > What's wrong with just having each device ask the host1x (its parent) > for a pointer to the (dummy) tegradrm device. That seems extremely > simple, and doesn

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-20 Thread Terje Bergström
On 20.12.2012 19:55, Stephen Warren wrote: > So it's fine for the tegradrm driver to manipulate the tegradrm > (virtual) device's drvdata pointer. > > It's not fine for tegradrm to manipulate the drvdata pointer of other > devices; the host1x children. The drvdata pointer for other devices is > re

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-20 Thread Terje Bergström
On 20.12.2012 22:30, Thierry Reding wrote: > The problem with your proposed solution is that, even any of Stephen's > valid objections aside, it won't work. Once the tegra-drm module is > unloaded, the driver's data will be left in the current state and the > link to the dummy device will be lost.

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2012-12-20 Thread Terje Bergström
On 21.12.2012 00:28, Stephen Warren wrote: > On 12/20/2012 02:34 PM, Terje Bergström wrote: >> On 20.12.2012 22:30, Thierry Reding wrote: >>> The problem with your proposed solution is that, even any of Stephen's >>> valid objections aside, it won't work. Once

Re: [PATCHv4 0/8] Support for Tegra 2D hardware

2012-12-21 Thread Terje Bergström
On 21.12.2012 15:50, Lucas Stach wrote: > This has to be resolved before merging. Personally I'm in favour of > keeping reg access patterns close to what is done in other parts of the > kernel. I haven't so far received comments from too many people, so that's why I left it as is. >> * Uses stil

Re: [PATCHv4 5/8] drm: tegra: Remove redundant host1x

2012-12-21 Thread Terje Bergström
On 21.12.2012 16:36, Thierry Reding wrote: > On Fri, Dec 21, 2012 at 01:39:21PM +0200, Terje Bergstrom wrote: >> +static struct platform_driver tegra_drm_platform_driver = { >> +.driver = { >> +.name = "tegradrm", > > This should be "tegra-drm" to match the module name. We've actu

Re: [RFC,libdrm 1/3] tegra: Add stream library

2012-12-30 Thread Terje Bergström
On 28.12.2012 22:48, Thierry Reding wrote: > I disagree. We shouldn't be hiding this kind of detail behind an #ifdef. > Instead it should be detected at runtime. Otherwise you'll need to build > different versions of libdrm for every generation of Tegra. That may be > fine for NVIDIA provided BSPs,

Re: [PATCHv4 5/8] drm: tegra: Remove redundant host1x

2012-12-30 Thread Terje Bergström
On 28.12.2012 23:21, Thierry Reding wrote: > Instead of going over this back and forth, I've decided to rewrite this > patch from scratch the way I think it should be done. Maybe that'll make > things clearer. I haven't tested it on real hardware yet because I don't > have access over the holidays,

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2013-01-01 Thread Terje Bergström
On 21.12.2012 23:19, Stephen Warren wrote: > * There's host1x hardware. > > * There's a low-level driver just for host1x itself; the host1x driver. > > * There's a high-level driver for the entire host1x complex of devices. > That is tegradrm. There may be more high-level drivers in the future >

Re: [RFC,libdrm 1/3] tegra: Add stream library

2013-01-01 Thread Terje Bergström
On 02.01.2013 04:44, Mark Zhang wrote: > Agree. If we are able to do something dynamically, normally that'll be > better. > > Terje, we can get the Tegra version in FUSE. I think we don't need this > kind of try-catch logics. We'd need to have in user space a map of SoC version -> number of sync

Re: [PATCHv4 0/8] Support for Tegra 2D hardware

2013-01-02 Thread Terje Bergström
On 26.12.2012 11:42, Mark Zhang wrote: > diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c > index a936902..28954b3 100644 > --- a/drivers/gpu/drm/tegra/gr2d.c > +++ b/drivers/gpu/drm/tegra/gr2d.c > @@ -247,6 +247,10 @@ static int __devinit gr2d_probe(struct > platform_device

Re: [PATCHv4 3/8] gpu: host1x: Add channel support

2013-01-02 Thread Terje Bergström
On 22.12.2012 06:17, Steven Rostedt wrote: > On Fri, 2012-12-21 at 13:39 +0200, Terje Bergstrom wrote: >> +TRACE_EVENT(host1x_cdma_begin, >> +TP_PROTO(const char *name), >> + >> +TP_ARGS(name), >> + >> +TP_STRUCT__entry( >> +__field(const char *, name) >> +), >> + >> +

Re: [PATCHv4 3/8] gpu: host1x: Add channel support

2013-01-02 Thread Terje Bergström
On 02.01.2013 09:40, Mark Zhang wrote: > On 12/21/2012 07:39 PM, Terje Bergstrom wrote: >> Add support for host1x client modules, and host1x channels to submit >> work to the clients. The work is submitted in GEM CMA buffers, so >> this patch adds support for them. >> >> Signed-off-by: Terje Bergst

Re: [PATCHv4 0/8] Support for Tegra 2D hardware

2013-01-02 Thread Terje Bergström
On 28.12.2012 11:14, Mark Zhang wrote: > diff --git a/drivers/gpu/drm/tegra/gr2d.c b/drivers/gpu/drm/tegra/gr2d.c > index a936902..c3ded60 100644 > --- a/drivers/gpu/drm/tegra/gr2d.c > +++ b/drivers/gpu/drm/tegra/gr2d.c > @@ -131,6 +131,14 @@ static int gr2d_submit(struct tegra_drm_context > *conte

Re: [PATCHv4 3/8] gpu: host1x: Add channel support

2013-01-02 Thread Terje Bergström
On 02.01.2013 11:31, Mark Zhang wrote: > On 01/02/2013 05:31 PM, Terje Bergström wrote: >> That's intentional. Writing a job to channel is atomic, so lock is taken >> from host1x_cdma_begin() until host1x_cdma_end(). >> > > Okay. So can we consider that lock and u

Re: [PATCHv4 0/8] Support for Tegra 2D hardware

2013-01-02 Thread Terje Bergström
On 03.01.2013 05:31, Mark Zhang wrote: > Sorry I didn't get it. Yes, in current design, you can pin all mem > handles in one time but I haven't found anything related with "locking > only once per submit". > > My idea is: > - remove "job->addr_phys" > - assign "job->reloc_addr_phys" & "job->gather

Re: [PATCHv4 0/8] Support for Tegra 2D hardware

2013-01-02 Thread Terje Bergström
On 21.12.2012 15:50, Lucas Stach wrote: > Am Freitag, den 21.12.2012, 13:39 +0200 schrieb Terje Bergstrom: >> Some of the issues left open: >> * Register definitions still use static inline. There has been a >>debate about code style versus ability to use compiler type >>checking and code

Re: [PATCHv4 5/8] drm: tegra: Remove redundant host1x

2013-01-03 Thread Terje Bergström
On 21.12.2012 16:36, Thierry Reding wrote: > On Fri, Dec 21, 2012 at 01:39:21PM +0200, Terje Bergstrom wrote: >> +static void tegra_drm_close(struct drm_device *drm, struct drm_file *filp) >> +{ >> + >> +} >> + > > This can be removed, right? Yes, done. > >> +static struct platform_driver tegra

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2013-01-04 Thread Terje Bergström
On 21.12.2012 23:19, Stephen Warren wrote: > I see the situation more like: > > * There's host1x hardware. > > * There's a low-level driver just for host1x itself; the host1x driver. > > * There's a high-level driver for the entire host1x complex of devices. > That is tegradrm. There may be more

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2013-01-07 Thread Terje Bergström
On 04.01.2013 22:25, Stephen Warren wrote: > On 01/04/2013 03:09 AM, Terje Bergström wrote: > ... >> I think we have now two ways to go forward with cons and pros: >> 1) Keep host1x and tegra-drm as separate driver >>+ Code almost done >>- we need

Re: [RFC v2 6/8] gpu: drm: tegra: Remove redundant host1x

2013-01-15 Thread Terje Bergström
On 15.01.2013 13:30, Thierry Reding wrote: > Sorry for not getting back to you on this earlier. I just remembered > this thread when I saw Terje's latest patch series. > > I agree that having everything in one location will make things a lot > easier, even if it means we have to add the tegra-drm

Re: [PATCHv5 7/8] ARM: tegra: Add board data and 2D clocks

2013-01-15 Thread Terje Bergström
On 15.01.2013 20:44, Stephen Warren wrote: >> diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c >> b/arch/arm/mach-tegra/board-dt-tegra20.c > >> +OF_DEV_AUXDATA("nvidia,tegra20-gr2d", 0x5414, "gr2d", NULL), > > I assume the only reason to add AUXDATA is to give the device a specific >

Re: [PATCHv5 7/8] ARM: tegra: Add board data and 2D clocks

2013-01-16 Thread Terje Bergström
On 15.01.2013 20:44, Stephen Warren wrote: > On 01/15/2013 04:26 AM, Terje Bergstrom wrote: >> Add a driver alias gr2d for Tegra 2D device, and assign a duplicate >> of 2D clock to that driver alias. > > FYI on this one patch - it won't be applied to the Tegra tree until > after Prashant's common

Re: [PATCH v2 5/5] drm/tegra: Implement page-flipping support

2013-01-22 Thread Terje Bergström
On 14.01.2013 18:06, Thierry Reding wrote: > +static int tegra_dc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer > *fb, > + struct drm_pending_vblank_event *event) > +{ > + struct tegra_framebuffer *newfb = to_tegra_fb(fb); > + struct tegra_dc *dc = to_te

  1   2   3   >