Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
xserver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Drew DeVault
xserver
Commits
26ff6121
Commit
26ff6121
authored
May 11, 2011
by
Zhigang Gong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
glamor: Resolved merge conflictions with Kristian's glamor-ddx patch.
parent
49bf0e30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
23 deletions
+42
-23
configure.ac
configure.ac
+1
-0
glamor/glamor.c
glamor/glamor.c
+38
-22
glamor/glamor.h
glamor/glamor.h
+2
-0
hw/xfree86/common/xf86pciBus.c
hw/xfree86/common/xf86pciBus.c
+1
-1
No files found.
configure.ac
View file @
26ff6121
...
...
@@ -2185,6 +2185,7 @@ hw/xfree86/utils/Makefile
hw/xfree86/utils/man/Makefile
hw/xfree86/utils/cvt/Makefile
hw/xfree86/utils/gtf/Makefile
hw/xfree86/glamor/Makefile
hw/dmx/config/Makefile
hw/dmx/config/man/Makefile
hw/dmx/doc/Makefile
...
...
glamor/glamor.c
View file @
26ff6121
...
...
@@ -59,25 +59,54 @@ glamor_get_drawable_pixmap(DrawablePtr drawable)
return
(
PixmapPtr
)
drawable
;
}
void
glamor_set_pixmap_texture
(
PixmapPtr
pixmap
,
int
w
,
int
h
,
unsigned
int
tex
)
{
ScreenPtr
screen
=
pixmap
->
drawable
.
pScreen
;
glamor_pixmap_private
*
pixmap_priv
;
pixmap_priv
=
glamor_get_pixmap_private
(
pixmap
);
pixmap_priv
->
tex
=
tex
;
/* Create a framebuffer object wrapping the texture so that we can render
* to it.
*/
glGenFramebuffersEXT
(
1
,
&
pixmap_priv
->
fb
);
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
pixmap_priv
->
fb
);
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
GL_TEXTURE_2D
,
pixmap_priv
->
tex
,
0
);
screen
->
ModifyPixmapHeader
(
pixmap
,
w
,
h
,
0
,
0
,
(((
w
*
pixmap
->
drawable
.
bitsPerPixel
+
7
)
/
8
)
+
3
)
&
~
3
,
NULL
);
}
static
PixmapPtr
glamor_create_pixmap
(
ScreenPtr
screen
,
int
w
,
int
h
,
int
depth
,
unsigned
int
usage
)
{
PixmapPtr
pixmap
;
glamor_pixmap_private
*
pixmap_priv
,
*
newpixmap_priv
;
GLenum
format
;
GLuint
tex
;
if
(
w
>
32767
||
h
>
32767
)
return
NullPixmap
;
pixmap
=
fbCreatePixmap
(
screen
,
0
,
0
,
depth
,
usage
);
if
(
dixAllocatePrivates
(
pixmap
->
devPrivates
,
PRIVATE_PIXMAP
)
!=
TRUE
)
{
fbDestroyPixmap
(
pixmap
);
ErrorF
(
"Fail to allocate privates for PIXMAP.
\n
"
);
return
NullPixmap
;
}
pixmap_priv
=
glamor_get_pixmap_private
(
pixmap
);
assert
(
pixmap_priv
!=
NULL
);
if
(
w
==
0
||
h
==
0
)
return
pixmap
;
...
...
@@ -95,28 +124,15 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
/* Create the texture used to store the pixmap's data. */
glGenTextures
(
1
,
&
pixmap_priv
->
tex
);
glBindTexture
(
GL_TEXTURE_2D
,
pixmap_priv
->
tex
);
glGenTextures
(
1
,
&
tex
);
glBindTexture
(
GL_TEXTURE_2D
,
tex
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
format
,
w
,
h
,
0
,
format
,
GL_UNSIGNED_BYTE
,
NULL
);
/* Create a framebuffer object wrapping the texture so that we can render
** to it.
**/
glGenFramebuffersEXT
(
1
,
&
pixmap_priv
->
fb
);
glBindFramebufferEXT
(
GL_FRAMEBUFFER_EXT
,
pixmap_priv
->
fb
);
glFramebufferTexture2DEXT
(
GL_FRAMEBUFFER_EXT
,
GL_COLOR_ATTACHMENT0_EXT
,
GL_TEXTURE_2D
,
pixmap_priv
->
tex
,
0
);
screen
->
ModifyPixmapHeader
(
pixmap
,
w
,
h
,
depth
,
0
,
(((
w
*
pixmap
->
drawable
.
bitsPerPixel
+
7
)
/
8
)
+
3
)
&
~
3
,
NULL
);
glamor_set_pixmap_texture
(
pixmap
,
w
,
h
,
tex
);
return
pixmap
;
}
...
...
@@ -149,6 +165,7 @@ Bool
glamor_init
(
ScreenPtr
screen
)
{
glamor_screen_private
*
glamor_priv
;
#ifdef RENDER
PictureScreenPtr
ps
=
GetPictureScreenIfSet
(
screen
);
#endif
...
...
@@ -173,7 +190,6 @@ glamor_init(ScreenPtr screen)
screen
->
myNum
);
}
glewInit
();
if
(
!
GLEW_EXT_framebuffer_object
)
{
...
...
@@ -196,13 +212,13 @@ glamor_init(ScreenPtr screen)
ErrorF
(
"GL_EXT_bgra required
\n
"
);
goto
fail
;
}
if
(
!
RegisterBlockAndWakeupHandlers
(
glamor_block_handler
,
glamor_wakeup_handler
,
NULL
))
{
goto
fail
;
}
glamor_priv
->
saved_close_screen
=
screen
->
CloseScreen
;
screen
->
CloseScreen
=
glamor_close_screen
;
...
...
glamor/glamor.h
View file @
26ff6121
...
...
@@ -37,5 +37,7 @@
#endif
/* GLAMOR_H */
Bool
glamor_init
(
ScreenPtr
screen
);
void
glamor_fini
(
ScreenPtr
screen
);
void
glamor_set_pixmap_texture
(
PixmapPtr
pixmap
,
int
w
,
int
h
,
unsigned
int
tex
);
hw/xfree86/common/xf86pciBus.c
View file @
26ff6121
...
...
@@ -1118,7 +1118,7 @@ videoPtrToDriverList(struct pci_device *dev,
}
else
if
(
dev
->
device_id
==
0x8108
)
{
break
;
/* "hooray" for poulsbo */
}
else
{
driverList
[
0
]
=
"intel
"
;
driverList
[
0
]
=
"glamor
"
;
}
break
;
case
0x102b
:
driverList
[
0
]
=
"mga"
;
break
;
...
...
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