Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mesa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
virgl-es
mesa
Commits
9087ba12
Commit
9087ba12
authored
Jun 03, 2010
by
Kristian Høgsberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intel: Take an intel_screen pointer in intel_alloc_region_* functions
parent
5aaa53e6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
37 deletions
+32
-37
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.c
+2
-1
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.c
+1
-1
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+1
-1
src/mesa/drivers/dri/intel/intel_regions.c
src/mesa/drivers/dri/intel/intel_regions.c
+24
-31
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/drivers/dri/intel/intel_regions.h
+2
-2
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.c
+2
-1
No files found.
src/mesa/drivers/dri/intel/intel_context.c
View file @
9087ba12
...
...
@@ -377,7 +377,8 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
intel_region_reference
(
&
region
,
depth_region
);
}
else
region
=
intel_region_alloc_for_handle
(
intel
,
buffers
[
i
].
cpp
,
region
=
intel_region_alloc_for_handle
(
intel
->
intelScreen
,
buffers
[
i
].
cpp
,
drawable
->
w
,
drawable
->
h
,
buffers
[
i
].
pitch
/
buffers
[
i
].
cpp
,
...
...
src/mesa/drivers/dri/intel/intel_fbo.c
View file @
9087ba12
...
...
@@ -182,7 +182,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
/* alloc hardware renderbuffer */
DBG
(
"Allocating %d x %d Intel RBO
\n
"
,
width
,
height
);
irb
->
region
=
intel_region_alloc
(
intel
,
I915_TILING_NONE
,
cpp
,
irb
->
region
=
intel_region_alloc
(
intel
->
intelScreen
,
I915_TILING_NONE
,
cpp
,
width
,
height
,
GL_TRUE
);
if
(
!
irb
->
region
)
return
GL_FALSE
;
/* out of memory? */
...
...
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
View file @
9087ba12
...
...
@@ -137,7 +137,7 @@ intel_miptree_create(struct intel_context *intel,
return
NULL
;
}
mt
->
region
=
intel_region_alloc
(
intel
,
mt
->
region
=
intel_region_alloc
(
intel
->
intelScreen
,
tiling
,
mt
->
cpp
,
mt
->
total_width
,
...
...
src/mesa/drivers/dri/intel/intel_regions.c
View file @
9087ba12
...
...
@@ -142,10 +142,10 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region)
}
static
struct
intel_region
*
intel_region_alloc_internal
(
struct
intel_
context
*
intel
,
intel_region_alloc_internal
(
struct
intel_
screen
*
screen
,
GLuint
cpp
,
GLuint
width
,
GLuint
height
,
GLuint
pitch
,
drm_intel_bo
*
buffer
)
uint32_t
tiling
,
drm_intel_bo
*
buffer
)
{
struct
intel_region
*
region
;
...
...
@@ -164,44 +164,36 @@ intel_region_alloc_internal(struct intel_context *intel,
region
->
pitch
=
pitch
;
region
->
refcount
=
1
;
region
->
buffer
=
buffer
;
/* Default to no tiling */
region
->
tiling
=
I915_TILING_NONE
;
region
->
tiling
=
tiling
;
region
->
screen
=
screen
;
_DBG
(
"%s <-- %p
\n
"
,
__FUNCTION__
,
region
);
return
region
;
}
struct
intel_region
*
intel_region_alloc
(
struct
intel_
context
*
intel
,
intel_region_alloc
(
struct
intel_
screen
*
screen
,
uint32_t
tiling
,
GLuint
cpp
,
GLuint
width
,
GLuint
height
,
GLboolean
expect_accelerated_upload
)
{
drm_intel_bo
*
buffer
;
struct
intel_region
*
region
;
unsigned
long
flags
=
0
;
unsigned
long
aligned_pitch
;
if
(
expect_accelerated_upload
)
flags
|=
BO_ALLOC_FOR_RENDER
;
buffer
=
drm_intel_bo_alloc_tiled
(
intel
->
bufmgr
,
"region"
,
buffer
=
drm_intel_bo_alloc_tiled
(
screen
->
bufmgr
,
"region"
,
width
,
height
,
cpp
,
&
tiling
,
&
aligned_pitch
,
flags
);
region
=
intel_region_alloc_internal
(
intel
,
cpp
,
width
,
height
,
aligned_pitch
/
cpp
,
buffer
);
if
(
region
==
NULL
)
return
region
;
region
->
tiling
=
tiling
;
return
region
;
return
intel_region_alloc_internal
(
screen
,
cpp
,
width
,
height
,
aligned_pitch
/
cpp
,
tiling
,
buffer
);
}
struct
intel_region
*
intel_region_alloc_for_handle
(
struct
intel_
context
*
intel
,
intel_region_alloc_for_handle
(
struct
intel_
screen
*
screen
,
GLuint
cpp
,
GLuint
width
,
GLuint
height
,
GLuint
pitch
,
GLuint
handle
,
const
char
*
name
)
...
...
@@ -209,9 +201,9 @@ intel_region_alloc_for_handle(struct intel_context *intel,
struct
intel_region
*
region
,
*
dummy
;
drm_intel_bo
*
buffer
;
int
ret
;
uint32_t
bit_6_swizzle
;
uint32_t
bit_6_swizzle
,
tiling
;
region
=
_mesa_HashLookup
(
intel
->
intelS
creen
->
named_regions
,
handle
);
region
=
_mesa_HashLookup
(
s
creen
->
named_regions
,
handle
);
if
(
region
!=
NULL
)
{
dummy
=
NULL
;
if
(
region
->
width
!=
width
||
region
->
height
!=
height
||
...
...
@@ -225,25 +217,26 @@ intel_region_alloc_for_handle(struct intel_context *intel,
return
dummy
;
}
buffer
=
intel_bo_gem_create_from_name
(
intel
->
bufmgr
,
name
,
handle
);
region
=
intel_region_alloc_internal
(
intel
,
cpp
,
width
,
height
,
pitch
,
buffer
);
if
(
region
==
NULL
)
return
region
;
ret
=
drm_intel_bo_get_tiling
(
region
->
buffer
,
&
region
->
tiling
,
&
bit_6_swizzle
);
buffer
=
intel_bo_gem_create_from_name
(
screen
->
bufmgr
,
name
,
handle
);
if
(
buffer
==
NULL
)
return
NULL
;
ret
=
drm_intel_bo_get_tiling
(
buffer
,
&
tiling
,
&
bit_6_swizzle
);
if
(
ret
!=
0
)
{
fprintf
(
stderr
,
"Couldn't get tiling of buffer %d (%s): %s
\n
"
,
handle
,
name
,
strerror
(
-
ret
));
intel_region_release
(
&
region
);
drm_intel_bo_unreference
(
buffer
);
return
NULL
;
}
region
=
intel_region_alloc_internal
(
screen
,
cpp
,
width
,
height
,
pitch
,
tiling
,
buffer
);
if
(
region
==
NULL
)
{
drm_intel_bo_unreference
(
buffer
);
return
NULL
;
}
region
->
name
=
handle
;
region
->
screen
=
intel
->
intelScreen
;
_mesa_HashInsert
(
intel
->
intelScreen
->
named_regions
,
handle
,
region
);
_mesa_HashInsert
(
screen
->
named_regions
,
handle
,
region
);
return
region
;
}
...
...
src/mesa/drivers/dri/intel/intel_regions.h
View file @
9087ba12
...
...
@@ -76,14 +76,14 @@ struct intel_region
/* Allocate a refcounted region. Pointers to regions should only be
* copied by calling intel_reference_region().
*/
struct
intel_region
*
intel_region_alloc
(
struct
intel_
context
*
intel
,
struct
intel_region
*
intel_region_alloc
(
struct
intel_
screen
*
screen
,
uint32_t
tiling
,
GLuint
cpp
,
GLuint
width
,
GLuint
height
,
GLboolean
expect_accelerated_upload
);
struct
intel_region
*
intel_region_alloc_for_handle
(
struct
intel_
context
*
intel
,
intel_region_alloc_for_handle
(
struct
intel_
screen
*
screen
,
GLuint
cpp
,
GLuint
width
,
GLuint
height
,
GLuint
pitch
,
unsigned
int
handle
,
const
char
*
name
);
...
...
src/mesa/drivers/dri/intel/intel_screen.c
View file @
9087ba12
...
...
@@ -159,7 +159,8 @@ intel_create_image_from_name(__DRIcontext *context,
image
->
data
=
loaderPrivate
;
cpp
=
_mesa_get_format_bytes
(
image
->
format
);
image
->
region
=
intel_region_alloc_for_handle
(
intel
,
cpp
,
width
,
height
,
image
->
region
=
intel_region_alloc_for_handle
(
intel
->
intelScreen
,
cpp
,
width
,
height
,
pitch
,
name
,
"image"
);
if
(
image
->
region
==
NULL
)
{
FREE
(
image
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment