diff mbox

[PATCHv2,4/4] pipe-loader: add pipe loader for freedreno/msm

Message ID 1392057261-25942-5-git-send-email-robdclark@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Rob Clark Feb. 10, 2014, 6:34 p.m. UTC
From: Rob Clark <robclark@freedesktop.org>

Signed-off-by: Rob Clark <robclark@freedesktop.org>
---
 src/gallium/targets/pipe-loader/Makefile.am | 16 ++++++++++++++++
 src/gallium/targets/pipe-loader/pipe_msm.c  | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c

Comments

Emil Velikov Feb. 11, 2014, 4:30 a.m. UTC | #1
On 10/02/14 18:34, Rob Clark wrote:
> From: Rob Clark <robclark@freedesktop.org>
> 
> Signed-off-by: Rob Clark <robclark@freedesktop.org>
> ---
>  src/gallium/targets/pipe-loader/Makefile.am | 16 ++++++++++++++++
>  src/gallium/targets/pipe-loader/pipe_msm.c  | 21 +++++++++++++++++++++
>  2 files changed, 37 insertions(+)
>  create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c
> 
> diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
> index 97733c1..8a0f254 100644
> --- a/src/gallium/targets/pipe-loader/Makefile.am
> +++ b/src/gallium/targets/pipe-loader/Makefile.am
> @@ -132,6 +132,22 @@ pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
>  endif
>  endif
>  
> +if HAVE_GALLIUM_FREEDRENO
> +pipe_LTLIBRARIES += pipe_msm.la
> +pipe_msm_la_SOURCES = pipe_msm.c
> +nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
> +pipe_msm_la_LIBADD = \
> +	$(PIPE_LIBS) \
> +	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
> +	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
Should have spotted this earlier, but it seems like you're forgot to
link against libdrm_freedreno ?

+ $(FREEDRENO_LIBS) \

-Emil
Rob Clark Feb. 11, 2014, 12:09 p.m. UTC | #2
On Mon, Feb 10, 2014 at 11:30 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> On 10/02/14 18:34, Rob Clark wrote:
>> From: Rob Clark <robclark@freedesktop.org>
>>
>> Signed-off-by: Rob Clark <robclark@freedesktop.org>
>> ---
>>  src/gallium/targets/pipe-loader/Makefile.am | 16 ++++++++++++++++
>>  src/gallium/targets/pipe-loader/pipe_msm.c  | 21 +++++++++++++++++++++
>>  2 files changed, 37 insertions(+)
>>  create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c
>>
>> diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
>> index 97733c1..8a0f254 100644
>> --- a/src/gallium/targets/pipe-loader/Makefile.am
>> +++ b/src/gallium/targets/pipe-loader/Makefile.am
>> @@ -132,6 +132,22 @@ pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
>>  endif
>>  endif
>>
>> +if HAVE_GALLIUM_FREEDRENO
>> +pipe_LTLIBRARIES += pipe_msm.la
>> +pipe_msm_la_SOURCES = pipe_msm.c
>> +nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
>> +pipe_msm_la_LIBADD = \
>> +     $(PIPE_LIBS) \
>> +     $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
>> +     $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
> Should have spotted this earlier, but it seems like you're forgot to
> link against libdrm_freedreno ?
>
> + $(FREEDRENO_LIBS) \

hmm, good point.. I wonder why it works?

> -Emil
Emil Velikov Feb. 11, 2014, 12:30 p.m. UTC | #3
On 11/02/14 12:09, Rob Clark wrote:
> On Mon, Feb 10, 2014 at 11:30 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>> On 10/02/14 18:34, Rob Clark wrote:
>>> From: Rob Clark <robclark@freedesktop.org>
>>>
>>> Signed-off-by: Rob Clark <robclark@freedesktop.org>
>>> ---
>>>  src/gallium/targets/pipe-loader/Makefile.am | 16 ++++++++++++++++
>>>  src/gallium/targets/pipe-loader/pipe_msm.c  | 21 +++++++++++++++++++++
>>>  2 files changed, 37 insertions(+)
>>>  create mode 100644 src/gallium/targets/pipe-loader/pipe_msm.c
>>>
>>> diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
>>> index 97733c1..8a0f254 100644
>>> --- a/src/gallium/targets/pipe-loader/Makefile.am
>>> +++ b/src/gallium/targets/pipe-loader/Makefile.am
>>> @@ -132,6 +132,22 @@ pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
>>>  endif
>>>  endif
>>>
>>> +if HAVE_GALLIUM_FREEDRENO
>>> +pipe_LTLIBRARIES += pipe_msm.la
>>> +pipe_msm_la_SOURCES = pipe_msm.c
>>> +nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
>>> +pipe_msm_la_LIBADD = \
>>> +     $(PIPE_LIBS) \
>>> +     $(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
>>> +     $(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
>> Should have spotted this earlier, but it seems like you're forgot to
>> link against libdrm_freedreno ?
>>
>> + $(FREEDRENO_LIBS) \
> 
> hmm, good point.. I wonder why it works?
> 
Guessing that the linker favours us or there is a bug somewhere :)

>> -Emil
diff mbox

Patch

diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index 97733c1..8a0f254 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -132,6 +132,22 @@  pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
 endif
 endif
 
+if HAVE_GALLIUM_FREEDRENO
+pipe_LTLIBRARIES += pipe_msm.la
+pipe_msm_la_SOURCES = pipe_msm.c
+nodist_EXTRA_pipe_msm_la_SOURCES = dummy.cpp
+pipe_msm_la_LIBADD = \
+	$(PIPE_LIBS) \
+	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
+	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
+	$(LIBDRM_LIBS)
+pipe_msm_la_LDFLAGS = -no-undefined -avoid-version -module
+if HAVE_MESA_LLVM
+pipe_msm_la_LIBADD += $(LLVM_LIBS)
+pipe_msm_la_LDFLAGS += $(LLVM_LDFLAGS)
+endif
+endif
+
 if HAVE_GALLIUM_SVGA
 pipe_LTLIBRARIES += pipe_vmwgfx.la
 pipe_vmwgfx_la_SOURCES = pipe_vmwgfx.c
diff --git a/src/gallium/targets/pipe-loader/pipe_msm.c b/src/gallium/targets/pipe-loader/pipe_msm.c
new file mode 100644
index 0000000..76e4023
--- /dev/null
+++ b/src/gallium/targets/pipe-loader/pipe_msm.c
@@ -0,0 +1,21 @@ 
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "freedreno/drm/freedreno_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+   struct pipe_screen *screen;
+
+   screen = fd_drm_screen_create(fd);
+   if (!screen)
+      return NULL;
+
+   screen = debug_screen_wrap(screen);
+
+   return screen;
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("msm", "freedreno", create_screen, NULL)