Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
80bc340b
Commit
80bc340b
authored
Aug 10, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
b76f1529
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
20 deletions
+47
-20
drivers/gpu/drm/nouveau/core/engine/disp/base.c
drivers/gpu/drm/nouveau/core/engine/disp/base.c
+19
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv04.c
drivers/gpu/drm/nouveau/core/engine/disp/nv04.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/disp/priv.h
drivers/gpu/drm/nouveau/core/engine/disp/priv.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+5
-5
drivers/gpu/drm/nouveau/nouveau_connector.h
drivers/gpu/drm/nouveau/nouveau_connector.h
+3
-1
drivers/gpu/drm/nouveau/nouveau_crtc.h
drivers/gpu/drm/nouveau/nouveau_crtc.h
+3
-1
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_display.c
+10
-10
drivers/gpu/drm/nouveau/nvif/class.h
drivers/gpu/drm/nouveau/nvif/class.h
+3
-1
drivers/gpu/drm/nouveau/nvif/device.h
drivers/gpu/drm/nouveau/nvif/device.h
+0
-2
No files found.
drivers/gpu/drm/nouveau/core/engine/disp/base.c
View file @
80bc340b
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <core/os.h>
#include <core/os.h>
#include <nvif/unpack.h>
#include <nvif/unpack.h>
#include <nvif/class.h>
#include <nvif/event.h>
#include <nvif/event.h>
#include "priv.h"
#include "priv.h"
...
@@ -92,6 +93,24 @@ nouveau_disp_hpd_func = {
...
@@ -92,6 +93,24 @@ nouveau_disp_hpd_func = {
.
ctor
=
nouveau_disp_hpd_ctor
.
ctor
=
nouveau_disp_hpd_ctor
};
};
int
nouveau_disp_ntfy
(
struct
nouveau_object
*
object
,
u32
type
,
struct
nvkm_event
**
event
)
{
struct
nouveau_disp
*
disp
=
(
void
*
)
object
->
engine
;
switch
(
type
)
{
case
NV04_DISP_NTFY_VBLANK
:
*
event
=
&
disp
->
vblank
;
return
0
;
case
NV04_DISP_NTFY_CONN
:
*
event
=
&
disp
->
hpd
;
return
0
;
default:
break
;
}
return
-
EINVAL
;
}
int
int
_nouveau_disp_fini
(
struct
nouveau_object
*
object
,
bool
suspend
)
_nouveau_disp_fini
(
struct
nouveau_object
*
object
,
bool
suspend
)
{
{
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv04.c
View file @
80bc340b
...
@@ -112,6 +112,7 @@ nv04_disp_ofuncs = {
...
@@ -112,6 +112,7 @@ nv04_disp_ofuncs = {
.
init
=
nouveau_object_init
,
.
init
=
nouveau_object_init
,
.
fini
=
nouveau_object_fini
,
.
fini
=
nouveau_object_fini
,
.
mthd
=
nv04_disp_mthd
,
.
mthd
=
nv04_disp_mthd
,
.
ntfy
=
nouveau_disp_ntfy
,
};
};
static
struct
nouveau_oclass
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
View file @
80bc340b
...
@@ -1142,6 +1142,7 @@ nv50_disp_base_ofuncs = {
...
@@ -1142,6 +1142,7 @@ nv50_disp_base_ofuncs = {
.
init
=
nv50_disp_base_init
,
.
init
=
nv50_disp_base_init
,
.
fini
=
nv50_disp_base_fini
,
.
fini
=
nv50_disp_base_fini
,
.
mthd
=
nv50_disp_base_mthd
,
.
mthd
=
nv50_disp_base_mthd
,
.
ntfy
=
nouveau_disp_ntfy
,
};
};
static
struct
nouveau_oclass
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
View file @
80bc340b
...
@@ -716,6 +716,7 @@ nvd0_disp_base_ofuncs = {
...
@@ -716,6 +716,7 @@ nvd0_disp_base_ofuncs = {
.
init
=
nvd0_disp_base_init
,
.
init
=
nvd0_disp_base_init
,
.
fini
=
nvd0_disp_base_fini
,
.
fini
=
nvd0_disp_base_fini
,
.
mthd
=
nv50_disp_base_mthd
,
.
mthd
=
nv50_disp_base_mthd
,
.
ntfy
=
nouveau_disp_ntfy
,
};
};
static
struct
nouveau_oclass
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/disp/priv.h
View file @
80bc340b
...
@@ -42,5 +42,6 @@ extern struct nouveau_oclass *nvkm_connector_oclass;
...
@@ -42,5 +42,6 @@ extern struct nouveau_oclass *nvkm_connector_oclass;
int
nouveau_disp_vblank_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
);
int
nouveau_disp_vblank_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
);
void
nouveau_disp_vblank
(
struct
nouveau_disp
*
,
int
head
);
void
nouveau_disp_vblank
(
struct
nouveau_disp
*
,
int
head
);
int
nouveau_disp_ntfy
(
struct
nouveau_object
*
,
u32
,
struct
nvkm_event
**
);
#endif
#endif
drivers/gpu/drm/nouveau/nouveau_connector.c
View file @
80bc340b
...
@@ -100,7 +100,7 @@ static void
...
@@ -100,7 +100,7 @@ static void
nouveau_connector_destroy
(
struct
drm_connector
*
connector
)
nouveau_connector_destroy
(
struct
drm_connector
*
connector
)
{
{
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
);
struct
nouveau_connector
*
nv_connector
=
nouveau_connector
(
connector
);
nv
km
_notify_fini
(
&
nv_connector
->
hpd
);
nv
if
_notify_fini
(
&
nv_connector
->
hpd
);
kfree
(
nv_connector
->
edid
);
kfree
(
nv_connector
->
edid
);
drm_connector_unregister
(
connector
);
drm_connector_unregister
(
connector
);
drm_connector_cleanup
(
connector
);
drm_connector_cleanup
(
connector
);
...
@@ -937,7 +937,7 @@ nouveau_connector_funcs_dp = {
...
@@ -937,7 +937,7 @@ nouveau_connector_funcs_dp = {
};
};
static
int
static
int
nouveau_connector_hotplug
(
struct
nv
km
_notify
*
notify
)
nouveau_connector_hotplug
(
struct
nv
if
_notify
*
notify
)
{
{
struct
nouveau_connector
*
nv_connector
=
struct
nouveau_connector
*
nv_connector
=
container_of
(
notify
,
typeof
(
*
nv_connector
),
hpd
);
container_of
(
notify
,
typeof
(
*
nv_connector
),
hpd
);
...
@@ -959,7 +959,7 @@ nouveau_connector_hotplug(struct nvkm_notify *notify)
...
@@ -959,7 +959,7 @@ nouveau_connector_hotplug(struct nvkm_notify *notify)
drm_helper_hpd_irq_event
(
connector
->
dev
);
drm_helper_hpd_irq_event
(
connector
->
dev
);
}
}
return
NV
KM
_NOTIFY_KEEP
;
return
NV
IF
_NOTIFY_KEEP
;
}
}
static
ssize_t
static
ssize_t
...
@@ -1029,7 +1029,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
...
@@ -1029,7 +1029,6 @@ nouveau_connector_create(struct drm_device *dev, int index)
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
nouveau_connector
*
nv_connector
=
NULL
;
struct
nouveau_connector
*
nv_connector
=
NULL
;
struct
nouveau_disp
*
pdisp
=
nvkm_disp
(
&
drm
->
device
);
struct
drm_connector
*
connector
;
struct
drm_connector
*
connector
;
int
type
,
ret
=
0
;
int
type
,
ret
=
0
;
bool
dummy
;
bool
dummy
;
...
@@ -1215,7 +1214,8 @@ nouveau_connector_create(struct drm_device *dev, int index)
...
@@ -1215,7 +1214,8 @@ nouveau_connector_create(struct drm_device *dev, int index)
break
;
break
;
}
}
ret
=
nvkm_notify_init
(
&
pdisp
->
hpd
,
nouveau_connector_hotplug
,
true
,
ret
=
nvif_notify_init
(
&
disp
->
disp
,
NULL
,
nouveau_connector_hotplug
,
true
,
NV04_DISP_NTFY_CONN
,
&
(
struct
nvif_notify_conn_req_v0
)
{
&
(
struct
nvif_notify_conn_req_v0
)
{
.
mask
=
NVIF_NOTIFY_CONN_V0_ANY
,
.
mask
=
NVIF_NOTIFY_CONN_V0_ANY
,
.
conn
=
index
,
.
conn
=
index
,
...
...
drivers/gpu/drm/nouveau/nouveau_connector.h
View file @
80bc340b
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#ifndef __NOUVEAU_CONNECTOR_H__
#ifndef __NOUVEAU_CONNECTOR_H__
#define __NOUVEAU_CONNECTOR_H__
#define __NOUVEAU_CONNECTOR_H__
#include <nvif/notify.h>
#include <drm/drm_edid.h>
#include <drm/drm_edid.h>
#include <drm/drm_dp_helper.h>
#include <drm/drm_dp_helper.h>
#include "nouveau_crtc.h"
#include "nouveau_crtc.h"
...
@@ -63,7 +65,7 @@ struct nouveau_connector {
...
@@ -63,7 +65,7 @@ struct nouveau_connector {
u8
index
;
u8
index
;
u8
*
dcb
;
u8
*
dcb
;
struct
nv
km
_notify
hpd
;
struct
nv
if
_notify
hpd
;
struct
drm_dp_aux
aux
;
struct
drm_dp_aux
aux
;
...
...
drivers/gpu/drm/nouveau/nouveau_crtc.h
View file @
80bc340b
...
@@ -27,11 +27,13 @@
...
@@ -27,11 +27,13 @@
#ifndef __NOUVEAU_CRTC_H__
#ifndef __NOUVEAU_CRTC_H__
#define __NOUVEAU_CRTC_H__
#define __NOUVEAU_CRTC_H__
#include <nvif/notify.h>
struct
nouveau_crtc
{
struct
nouveau_crtc
{
struct
drm_crtc
base
;
struct
drm_crtc
base
;
int
index
;
int
index
;
struct
nv
km
_notify
vblank
;
struct
nv
if
_notify
vblank
;
uint32_t
dpms_saved_fp_control
;
uint32_t
dpms_saved_fp_control
;
uint32_t
fp_users
;
uint32_t
fp_users
;
...
...
drivers/gpu/drm/nouveau/nouveau_display.c
View file @
80bc340b
...
@@ -42,12 +42,12 @@
...
@@ -42,12 +42,12 @@
#include <nvif/event.h>
#include <nvif/event.h>
static
int
static
int
nouveau_display_vblank_handler
(
struct
nv
km
_notify
*
notify
)
nouveau_display_vblank_handler
(
struct
nv
if
_notify
*
notify
)
{
{
struct
nouveau_crtc
*
nv_crtc
=
struct
nouveau_crtc
*
nv_crtc
=
container_of
(
notify
,
typeof
(
*
nv_crtc
),
vblank
);
container_of
(
notify
,
typeof
(
*
nv_crtc
),
vblank
);
drm_handle_vblank
(
nv_crtc
->
base
.
dev
,
nv_crtc
->
index
);
drm_handle_vblank
(
nv_crtc
->
base
.
dev
,
nv_crtc
->
index
);
return
NV
KM
_NOTIFY_KEEP
;
return
NV
IF
_NOTIFY_KEEP
;
}
}
int
int
...
@@ -57,7 +57,7 @@ nouveau_display_vblank_enable(struct drm_device *dev, int head)
...
@@ -57,7 +57,7 @@ nouveau_display_vblank_enable(struct drm_device *dev, int head)
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
if
(
nv_crtc
->
index
==
head
)
{
if
(
nv_crtc
->
index
==
head
)
{
nv
km
_notify_get
(
&
nv_crtc
->
vblank
);
nv
if
_notify_get
(
&
nv_crtc
->
vblank
);
return
0
;
return
0
;
}
}
}
}
...
@@ -71,7 +71,7 @@ nouveau_display_vblank_disable(struct drm_device *dev, int head)
...
@@ -71,7 +71,7 @@ nouveau_display_vblank_disable(struct drm_device *dev, int head)
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
if
(
nv_crtc
->
index
==
head
)
{
if
(
nv_crtc
->
index
==
head
)
{
nv
km
_notify_put
(
&
nv_crtc
->
vblank
);
nv
if
_notify_put
(
&
nv_crtc
->
vblank
);
return
;
return
;
}
}
}
}
...
@@ -172,22 +172,22 @@ nouveau_display_vblank_fini(struct drm_device *dev)
...
@@ -172,22 +172,22 @@ nouveau_display_vblank_fini(struct drm_device *dev)
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
nv
km
_notify_fini
(
&
nv_crtc
->
vblank
);
nv
if
_notify_fini
(
&
nv_crtc
->
vblank
);
}
}
}
}
static
int
static
int
nouveau_display_vblank_init
(
struct
drm_device
*
dev
)
nouveau_display_vblank_init
(
struct
drm_device
*
dev
)
{
{
struct
nouveau_drm
*
drm
=
nouveau_drm
(
dev
);
struct
nouveau_display
*
disp
=
nouveau_display
(
dev
);
struct
nouveau_disp
*
pdisp
=
nvkm_disp
(
&
drm
->
device
);
struct
drm_crtc
*
crtc
;
struct
drm_crtc
*
crtc
;
int
ret
;
int
ret
;
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
list_for_each_entry
(
crtc
,
&
dev
->
mode_config
.
crtc_list
,
head
)
{
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
struct
nouveau_crtc
*
nv_crtc
=
nouveau_crtc
(
crtc
);
ret
=
nv
km_notify_init
(
&
pdisp
->
vblank
,
ret
=
nv
if_notify_init
(
&
disp
->
disp
,
NULL
,
nouveau_display_vblank_handler
,
false
,
nouveau_display_vblank_handler
,
false
,
NV04_DISP_NTFY_VBLANK
,
&
(
struct
nvif_notify_head_req_v0
)
{
&
(
struct
nvif_notify_head_req_v0
)
{
.
head
=
nv_crtc
->
index
,
.
head
=
nv_crtc
->
index
,
},
},
...
@@ -371,7 +371,7 @@ nouveau_display_init(struct drm_device *dev)
...
@@ -371,7 +371,7 @@ nouveau_display_init(struct drm_device *dev)
/* enable hotplug interrupts */
/* enable hotplug interrupts */
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
nv
km
_notify_get
(
&
conn
->
hpd
);
nv
if
_notify_get
(
&
conn
->
hpd
);
}
}
return
ret
;
return
ret
;
...
@@ -391,7 +391,7 @@ nouveau_display_fini(struct drm_device *dev)
...
@@ -391,7 +391,7 @@ nouveau_display_fini(struct drm_device *dev)
/* disable hotplug interrupts */
/* disable hotplug interrupts */
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
struct
nouveau_connector
*
conn
=
nouveau_connector
(
connector
);
nv
km
_notify_put
(
&
conn
->
hpd
);
nv
if
_notify_put
(
&
conn
->
hpd
);
}
}
drm_kms_helper_poll_disable
(
dev
);
drm_kms_helper_poll_disable
(
dev
);
...
...
drivers/gpu/drm/nouveau/nvif/class.h
View file @
80bc340b
...
@@ -343,6 +343,9 @@ struct kepler_channel_gpfifo_a_v0 {
...
@@ -343,6 +343,9 @@ struct kepler_channel_gpfifo_a_v0 {
* legacy display
* legacy display
******************************************************************************/
******************************************************************************/
#define NV04_DISP_NTFY_VBLANK 0x00
#define NV04_DISP_NTFY_CONN 0x01
struct
nv04_disp_mthd_v0
{
struct
nv04_disp_mthd_v0
{
__u8
version
;
__u8
version
;
#define NV04_DISP_SCANOUTPOS 0x00
#define NV04_DISP_SCANOUTPOS 0x00
...
@@ -365,7 +368,6 @@ struct nv04_disp_scanoutpos_v0 {
...
@@ -365,7 +368,6 @@ struct nv04_disp_scanoutpos_v0 {
__u16
hline
;
__u16
hline
;
};
};
/*******************************************************************************
/*******************************************************************************
* display
* display
******************************************************************************/
******************************************************************************/
...
...
drivers/gpu/drm/nouveau/nvif/device.h
View file @
80bc340b
...
@@ -54,13 +54,11 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **);
...
@@ -54,13 +54,11 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **);
#include <engine/device.h>
#include <engine/device.h>
#include <engine/fifo.h>
#include <engine/fifo.h>
#include <engine/disp.h>
#include <engine/graph.h>
#include <engine/graph.h>
#include <engine/software.h>
#include <engine/software.h>
#define nvkm_fifo(a) nouveau_fifo(nvkm_device(a))
#define nvkm_fifo(a) nouveau_fifo(nvkm_device(a))
#define nvkm_fifo_chan(a) ((struct nouveau_fifo_chan *)nvkm_object(a))
#define nvkm_fifo_chan(a) ((struct nouveau_fifo_chan *)nvkm_object(a))
#define nvkm_disp(a) nouveau_disp(nvkm_device(a))
#define nvkm_gr(a) ((struct nouveau_graph *)nouveau_engine(nvkm_object(a), NVDEV_ENGINE_GR))
#define nvkm_gr(a) ((struct nouveau_graph *)nouveau_engine(nvkm_object(a), NVDEV_ENGINE_GR))
#endif
#endif
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