[Mesa-dev] [PATCH 1/3] targets/egl: rename pipe_radeon to pipe_r300

Marek Olšák maraeo at gmail.com
Sun Aug 22 11:13:45 PDT 2010


On Sun, Aug 22, 2010 at 6:58 PM, Corbin Simpson
<mostawesomedude at gmail.com>wrote:

> On Sun, Aug 22, 2010 at 9:24 AM, Benjamin Franzke
> <benjaminfranzke at googlemail.com> wrote:
> > st/egl/x11/x11_screen.c requests a driver named r300 not radeon
> >
> > KNOWN ISSUE: breaks st/egl/kms/
> >        st/egl/kms requests a pipe named "radeon"
> >        that will not be found now
> >
> >        so why not leaving pipe_radeon there?
> >        that was possible as long we have only r300g.
> >        now there is also r600g for which st/egl/kms also
> >        requests a pipe named "radeon"
> >        (possible solution in later commit)
> > ---
> >  src/gallium/targets/egl/Makefile      |   14 +++++++-------
> >  src/gallium/targets/egl/pipe_r300.c   |   27 +++++++++++++++++++++++++++
> >  src/gallium/targets/egl/pipe_radeon.c |   27 ---------------------------
> >  3 files changed, 34 insertions(+), 34 deletions(-)
> >  create mode 100644 src/gallium/targets/egl/pipe_r300.c
> >  delete mode 100644 src/gallium/targets/egl/pipe_radeon.c
> >
> > diff --git a/src/gallium/targets/egl/Makefile
> b/src/gallium/targets/egl/Makefile
> > index 1585e2d..636fceb 100644
> > --- a/src/gallium/targets/egl/Makefile
> > +++ b/src/gallium/targets/egl/Makefile
> > @@ -90,10 +90,10 @@ nouveau_LIBS := \
> >        $(TOP)/src/gallium/drivers/nv50/libnv50.a \
> >        $(TOP)/src/gallium/drivers/nouveau/libnouveau.a
> >
> > -# radeon pipe driver
> > -radeon_CPPFLAGS :=
> > -radeon_SYS := -ldrm -ldrm_radeon
> > -radeon_LIBS := \
> > +# r300 pipe driver
> > +r300_CPPFLAGS :=
> > +r300_SYS := -ldrm -ldrm_radeon
> > +r300_LIBS := \
> >        $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
> >        $(TOP)/src/gallium/drivers/r300/libr300.a
> >
> > @@ -151,7 +151,7 @@ ifneq ($(findstring
> nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
> >  OUTPUTS += nouveau
> >  endif
> >  ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
> > -OUTPUTS += radeon
> > +OUTPUTS += r300
> >  endif
> >  ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
> >  OUTPUTS += vmwgfx
> > @@ -188,8 +188,8 @@ $(OUTPUT_PATH)/$(PIPE_PREFIX)i965.so: pipe_i965.o
> $(i965_LIBS)
> >  $(OUTPUT_PATH)/$(PIPE_PREFIX)nouveau.so: pipe_nouveau.o $(nouveau_LIBS)
> >        $(call mklib,nouveau)
> >
> > -$(OUTPUT_PATH)/$(PIPE_PREFIX)radeon.so: pipe_radeon.o $(radeon_LIBS)
> > -       $(call mklib,radeon)
> > +$(OUTPUT_PATH)/$(PIPE_PREFIX)r300.so: pipe_r300.o $(r300_LIBS)
> > +       $(call mklib,r300)
> >
> >  $(OUTPUT_PATH)/$(PIPE_PREFIX)vmwgfx.so: pipe_vmwgfx.o $(vmwgfx_LIBS)
> >        $(call mklib,vmwgfx)
> > diff --git a/src/gallium/targets/egl/pipe_r300.c
> b/src/gallium/targets/egl/pipe_r300.c
> > new file mode 100644
> > index 0000000..2fa495e
> > --- /dev/null
> > +++ b/src/gallium/targets/egl/pipe_r300.c
> > @@ -0,0 +1,27 @@
> > +
> > +#include "target-helpers/inline_debug_helper.h"
> > +#include "state_tracker/drm_driver.h"
> > +#include "radeon/drm/radeon_drm_public.h"
> > +#include "r300/r300_public.h"
> > +
> > +static struct pipe_screen *
> > +create_screen(int fd)
> > +{
> > +   struct r300_winsys_screen *sws;
> > +   struct pipe_screen *screen;
> > +
> > +   sws = r300_drm_winsys_screen_create(fd);
> > +   if (!sws)
> > +      return NULL;
> > +
> > +   screen = r300_screen_create(sws);
> > +   if (!screen)
> > +      return NULL;
> > +
> > +   screen = debug_screen_wrap(screen);
> > +
> > +   return screen;
> > +}
> > +
> > +PUBLIC
> > +DRM_DRIVER_DESCRIPTOR("r300", "r300", create_screen)
> > diff --git a/src/gallium/targets/egl/pipe_radeon.c
> b/src/gallium/targets/egl/pipe_radeon.c
> > deleted file mode 100644
> > index 35550bc..0000000
> > --- a/src/gallium/targets/egl/pipe_radeon.c
> > +++ /dev/null
> > @@ -1,27 +0,0 @@
> > -
> > -#include "target-helpers/inline_debug_helper.h"
> > -#include "state_tracker/drm_driver.h"
> > -#include "radeon/drm/radeon_drm_public.h"
> > -#include "r300/r300_public.h"
> > -
> > -static struct pipe_screen *
> > -create_screen(int fd)
> > -{
> > -   struct r300_winsys_screen *sws;
> > -   struct pipe_screen *screen;
> > -
> > -   sws = r300_drm_winsys_screen_create(fd);
> > -   if (!sws)
> > -      return NULL;
> > -
> > -   screen = r300_screen_create(sws);
> > -   if (!screen)
> > -      return NULL;
> > -
> > -   screen = debug_screen_wrap(screen);
> > -
> > -   return screen;
> > -}
> > -
> > -PUBLIC
> > -DRM_DRIVER_DESCRIPTOR("radeon", "radeon", create_screen)
> > --
> > 1.7.1
>
> I'm not so sure about this series, because (a) it should be possible
> to come up with something that works for both EGL backends (b) we
> haven't decided yet how much code r300g and r600g get to share.
>

(a) I agree.

(b) So far it seems to me that the strategy is to copy-paste useful pieces
of code from r300g to r600g and reinventing the wheel elsewhere, instead of
code sharing. My idea is that r300_xxx and r600_xxx structures should
inherit yet-non-existent structures radeon_xxx which should be used by
common code, and these in turn should inherit pipe_xxx. This way we don't
have to redirect all entrypoints to a driver like in galahad, only the ones
we want to override. At least all buffer management and texture transfer
code could be shared. Then, the drivers would not need to implement
entrypoints like user_buffer_create and transfers and some other resource
entrypoints, and an alternate low-level bufmgr interface would be provided
the drivers must implement instead.

The idea of sharing winsys is pretty much dead, as you probably already
know. I think Jerome wants to move some of the r600g winsys code into
kernel.

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100822/49831021/attachment.html>


More information about the mesa-dev mailing list