mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 04:40:09 +01:00
r600g: Move bootstrap code to target
This commit is contained in:
parent
cf91accc93
commit
92fde20de3
8 changed files with 48 additions and 36 deletions
|
|
@ -29,7 +29,7 @@
|
||||||
#include <util/u_math.h>
|
#include <util/u_math.h>
|
||||||
#include <util/u_inlines.h>
|
#include <util/u_inlines.h>
|
||||||
#include <util/u_memory.h>
|
#include <util/u_memory.h>
|
||||||
#include "state_tracker/drm_api.h"
|
#include "state_tracker/drm_driver.h"
|
||||||
#include "r600_screen.h"
|
#include "r600_screen.h"
|
||||||
#include "r600_context.h"
|
#include "r600_context.h"
|
||||||
|
|
||||||
|
|
|
||||||
9
src/gallium/drivers/r600/r600_public.h
Normal file
9
src/gallium/drivers/r600/r600_public.h
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
#ifndef R600_PUBLIC_H
|
||||||
|
#define R600_PUBLIC_H
|
||||||
|
|
||||||
|
struct radeon;
|
||||||
|
|
||||||
|
struct pipe_screen* r600_screen_create(struct radeon *rw);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "r600_screen.h"
|
#include "r600_screen.h"
|
||||||
#include "r600_texture.h"
|
#include "r600_texture.h"
|
||||||
#include "r600_context.h"
|
#include "r600_context.h"
|
||||||
|
#include "r600_public.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static const char* r600_get_vendor(struct pipe_screen* pscreen)
|
static const char* r600_get_vendor(struct pipe_screen* pscreen)
|
||||||
|
|
@ -240,7 +241,7 @@ static void r600_destroy_screen(struct pipe_screen* pscreen)
|
||||||
FREE(rscreen);
|
FREE(rscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pipe_screen *radeon_create_screen(struct radeon *rw)
|
struct pipe_screen *r600_screen_create(struct radeon *rw)
|
||||||
{
|
{
|
||||||
struct r600_screen* rscreen;
|
struct r600_screen* rscreen;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include <util/u_math.h>
|
#include <util/u_math.h>
|
||||||
#include <util/u_inlines.h>
|
#include <util/u_inlines.h>
|
||||||
#include <util/u_memory.h>
|
#include <util/u_memory.h>
|
||||||
#include "state_tracker/drm_api.h"
|
#include "state_tracker/drm_driver.h"
|
||||||
#include "r600_screen.h"
|
#include "r600_screen.h"
|
||||||
#include "r600_texture.h"
|
#include "r600_texture.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ typedef uint8_t u8;
|
||||||
|
|
||||||
struct radeon;
|
struct radeon;
|
||||||
|
|
||||||
struct pipe_screen *radeon_create_screen(struct radeon *rw);
|
|
||||||
|
|
||||||
enum radeon_family {
|
enum radeon_family {
|
||||||
CHIP_UNKNOWN,
|
CHIP_UNKNOWN,
|
||||||
CHIP_R100,
|
CHIP_R100,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,23 @@
|
||||||
|
|
||||||
#include "target-helpers/drm_api_compat.h"
|
#include "state_tracker/drm_driver.h"
|
||||||
|
#include "r600/drm/r600_drm_public.h"
|
||||||
|
#include "r600/r600_public.h"
|
||||||
|
|
||||||
DRM_API_COMPAT_STRUCT("r600", "radeon")
|
static struct pipe_screen *
|
||||||
|
create_screen(int fd)
|
||||||
|
{
|
||||||
|
struct radeon *rw;
|
||||||
|
struct pipe_screen *screen;
|
||||||
|
|
||||||
|
rw = r600_drm_winsys_create(fd);
|
||||||
|
if (!rw)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
screen = r600_screen_create(rw);
|
||||||
|
if (!screen)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return screen;
|
||||||
|
}
|
||||||
|
|
||||||
|
DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)
|
||||||
|
|
|
||||||
|
|
@ -26,21 +26,18 @@
|
||||||
* Joakim Sindholt <opensource@zhasha.com>
|
* Joakim Sindholt <opensource@zhasha.com>
|
||||||
*/
|
*/
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include "trace/tr_drm.h"
|
|
||||||
#include "util/u_inlines.h"
|
#include "util/u_inlines.h"
|
||||||
#include "util/u_debug.h"
|
#include "util/u_debug.h"
|
||||||
#include "state_tracker/drm_api.h"
|
|
||||||
#include "radeon_priv.h"
|
#include "radeon_priv.h"
|
||||||
#include "r600_screen.h"
|
#include "r600_screen.h"
|
||||||
#include "r600_texture.h"
|
#include "r600_texture.h"
|
||||||
|
#include "r600_public.h"
|
||||||
|
#include "r600_drm_public.h"
|
||||||
|
#include "state_tracker/drm_driver.h"
|
||||||
|
|
||||||
static struct pipe_screen *r600_drm_create_screen(struct drm_api* api, int drmfd)
|
struct radeon *r600_drm_winsys_create(int drmfd)
|
||||||
{
|
{
|
||||||
struct radeon *rw = radeon_new(drmfd, 0);
|
return radeon_new(drmfd, 0);
|
||||||
|
|
||||||
if (rw == NULL)
|
|
||||||
return NULL;
|
|
||||||
return radeon_create_screen(rw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean r600_buffer_get_handle(struct radeon *rw,
|
boolean r600_buffer_get_handle(struct radeon *rw,
|
||||||
|
|
@ -63,24 +60,3 @@ boolean r600_buffer_get_handle(struct radeon *rw,
|
||||||
whandle->handle = rbuffer->flink;
|
whandle->handle = rbuffer->flink;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void r600_drm_api_destroy(struct drm_api *api)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct drm_api drm_api_hooks = {
|
|
||||||
.name = "r600",
|
|
||||||
.driver_name = "r600",
|
|
||||||
.create_screen = r600_drm_create_screen,
|
|
||||||
.destroy = r600_drm_api_destroy,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct drm_api* drm_api_create()
|
|
||||||
{
|
|
||||||
#ifdef DEBUG
|
|
||||||
return trace_drm_create(&drm_api_hooks);
|
|
||||||
#else
|
|
||||||
return &drm_api_hooks;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
|
||||||
9
src/gallium/winsys/r600/drm/r600_drm_public.h
Normal file
9
src/gallium/winsys/r600/drm/r600_drm_public.h
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
#ifndef R600_DRM_PUBLIC_H
|
||||||
|
#define R600_DRM_PUBLIC_H
|
||||||
|
|
||||||
|
struct radeon;
|
||||||
|
|
||||||
|
struct radeon *r600_drm_winsys_create(int drmFD);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Add table
Reference in a new issue