diff mbox

drm/etnaviv: don't fail to build on arches without PHYS_OFFSET

Message ID 20180107145635.28403-1-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach Jan. 7, 2018, 2:56 p.m. UTC
Some architecture ports like ARC don't provide the PHYS_OFFSET symbol.
Define it to 0 in that case, which is the most conservative default in
the usage context of the etnaviv driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Joshua Clayton Jan. 8, 2018, 6:16 p.m. UTC | #1
It seems wrong to define PHYS_OFFSET here in a gpu driver.
Is there an actual ARC system using vivante?
The bit of code that uses PHYS_OFFSET looks pretty ARM specific.

If not, then at least maybe

+#if !define (PHYS_OFFSET) && defined (COMPILE_TEST)
+#define PHY_OFFSET 0
+#endif

would be more appropriate?

Maybe the use of PHYS_OFFSET should be moved into an inline in a header
where it can be defined differently for other arches

On Sun, Jan 7, 2018 at 7:56 AM, Lucas Stach <l.stach@pengutronix.de> wrote:

> Some architecture ports like ARC don't provide the PHYS_OFFSET symbol.
> Define it to 0 in that case, which is the most conservative default in
> the usage context of the etnaviv driver.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index 935d99be748e..febbd1e5bbc7 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -31,6 +31,10 @@
>  #include "state_hi.xml.h"
>  #include "cmdstream.xml.h"
>
> +#ifndef PHYS_OFFSET
> +#define PHYS_OFFSET 0
> +#endif
> +
>  static const struct platform_device_id gpu_ids[] = {
>         { .name = "etnaviv-gpu,2d" },
>         { },
> --
> 2.11.0
>
> _______________________________________________
> etnaviv mailing list
> etnaviv@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
>
Lucas Stach Jan. 9, 2018, 10:06 a.m. UTC | #2
Am Montag, den 08.01.2018, 11:16 -0700 schrieb Joshua Clayton:
> It seems wrong to define PHYS_OFFSET here in a gpu driver.
> Is there an actual ARC system using vivante?

Yes.

> The bit of code that uses PHYS_OFFSET looks pretty ARM specific.
> 
> If not, then at least maybe
> 
> +#if !define (PHYS_OFFSET) && defined (COMPILE_TEST)
> +#define PHY_OFFSET 0
> +#endif
> 
> would be more appropriate?
> 
> Maybe the use of PHYS_OFFSET should be moved into an inline in a
> header
> where it can be defined differently for other arches

I don't want to spread the symbol around. It is defined to some
(etnaviv specific) safe value in exactly the compilation unit where it
is used.

Regards,
Lucas

> On Sun, Jan 7, 2018 at 7:56 AM, Lucas Stach <l.stach@pengutronix.de>
> wrote:
> > Some architecture ports like ARC don't provide the PHYS_OFFSET
> > symbol.
> > Define it to 0 in that case, which is the most conservative default
> > in
> > the usage context of the etnaviv driver.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> > ---
> >  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > index 935d99be748e..febbd1e5bbc7 100644
> > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> > @@ -31,6 +31,10 @@
> >  #include "state_hi.xml.h"
> >  #include "cmdstream.xml.h"
> > 
> > +#ifndef PHYS_OFFSET
> > +#define PHYS_OFFSET 0
> > +#endif
> > +
> >  static const struct platform_device_id gpu_ids[] = {
> >         { .name = "etnaviv-gpu,2d" },
> >         { },
> > --
> > 2.11.0
> > 
> > _______________________________________________
> > etnaviv mailing list
> > etnaviv@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/etnaviv
> > 
> 
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 935d99be748e..febbd1e5bbc7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -31,6 +31,10 @@ 
 #include "state_hi.xml.h"
 #include "cmdstream.xml.h"
 
+#ifndef PHYS_OFFSET
+#define PHYS_OFFSET 0
+#endif
+
 static const struct platform_device_id gpu_ids[] = {
 	{ .name = "etnaviv-gpu,2d" },
 	{ },