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
c9d49590
Commit
c9d49590
authored
Jul 11, 2013
by
Patrik Jakobsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/gma500: Convert to generic encoder funcs
Signed-off-by:
Patrik Jakobsson
<
patrik.r.jakobsson@gmail.com
>
parent
59345847
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
58 additions
and
124 deletions
+58
-124
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_crt.c
+6
-7
drivers/gpu/drm/gma500/cdv_intel_display.c
drivers/gpu/drm/gma500/cdv_intel_display.c
+2
-2
drivers/gpu/drm/gma500/cdv_intel_dp.c
drivers/gpu/drm/gma500/cdv_intel_dp.c
+9
-8
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+9
-10
drivers/gpu/drm/gma500/cdv_intel_lvds.c
drivers/gpu/drm/gma500/cdv_intel_lvds.c
+4
-5
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/framebuffer.c
+1
-1
drivers/gpu/drm/gma500/gma_display.c
drivers/gpu/drm/gma500/gma_display.c
+2
-2
drivers/gpu/drm/gma500/mdfld_intel_display.c
drivers/gpu/drm/gma500/mdfld_intel_display.c
+1
-1
drivers/gpu/drm/gma500/oaktrail_crtc.c
drivers/gpu/drm/gma500/oaktrail_crtc.c
+1
-1
drivers/gpu/drm/gma500/oaktrail_hdmi.c
drivers/gpu/drm/gma500/oaktrail_hdmi.c
+4
-5
drivers/gpu/drm/gma500/oaktrail_lvds.c
drivers/gpu/drm/gma500/oaktrail_lvds.c
+1
-2
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/gma500/psb_drv.c
+1
-1
drivers/gpu/drm/gma500/psb_intel_display.c
drivers/gpu/drm/gma500/psb_intel_display.c
+2
-45
drivers/gpu/drm/gma500/psb_intel_drv.h
drivers/gpu/drm/gma500/psb_intel_drv.h
+0
-17
drivers/gpu/drm/gma500/psb_intel_lvds.c
drivers/gpu/drm/gma500/psb_intel_lvds.c
+7
-8
drivers/gpu/drm/gma500/psb_intel_sdvo.c
drivers/gpu/drm/gma500/psb_intel_sdvo.c
+8
-9
No files found.
drivers/gpu/drm/gma500/cdv_intel_crt.c
View file @
c9d49590
...
...
@@ -198,7 +198,7 @@ static enum drm_connector_status cdv_intel_crt_detect(
static
void
cdv_intel_crt_destroy
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
psb_intel_i2c_destroy
(
psb_intel_encoder
->
ddc_bus
);
drm_sysfs_connector_remove
(
connector
);
...
...
@@ -209,7 +209,7 @@ static void cdv_intel_crt_destroy(struct drm_connector *connector)
static
int
cdv_intel_crt_get_modes
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
return
psb_intel_ddc_get_modes
(
connector
,
&
psb_intel_encoder
->
ddc_bus
->
adapter
);
}
...
...
@@ -227,8 +227,8 @@ static int cdv_intel_crt_set_property(struct drm_connector *connector,
static
const
struct
drm_encoder_helper_funcs
cdv_intel_crt_helper_funcs
=
{
.
dpms
=
cdv_intel_crt_dpms
,
.
mode_fixup
=
cdv_intel_crt_mode_fixup
,
.
prepare
=
psb_intel
_encoder_prepare
,
.
commit
=
psb_intel
_encoder_commit
,
.
prepare
=
gma
_encoder_prepare
,
.
commit
=
gma
_encoder_commit
,
.
mode_set
=
cdv_intel_crt_mode_set
,
};
...
...
@@ -244,7 +244,7 @@ static const struct drm_connector_helper_funcs
cdv_intel_crt_connector_helper_funcs
=
{
.
mode_valid
=
cdv_intel_crt_mode_valid
,
.
get_modes
=
cdv_intel_crt_get_modes
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
void
cdv_intel_crt_enc_destroy
(
struct
drm_encoder
*
encoder
)
...
...
@@ -284,8 +284,7 @@ void cdv_intel_crt_init(struct drm_device *dev,
drm_encoder_init
(
dev
,
encoder
,
&
cdv_intel_crt_enc_funcs
,
DRM_MODE_ENCODER_DAC
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
/* Set up the DDC bus. */
i2c_reg
=
GPIOA
;
...
...
drivers/gpu/drm/gma500/cdv_intel_display.c
View file @
c9d49590
...
...
@@ -499,7 +499,7 @@ static bool is_pipeb_lvds(struct drm_device *dev, struct drm_crtc *crtc)
list_for_each_entry
(
connector
,
&
mode_config
->
connector_list
,
head
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
!
connector
->
encoder
||
connector
->
encoder
->
crtc
!=
crtc
)
...
...
@@ -634,7 +634,7 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
list_for_each_entry
(
connector
,
&
mode_config
->
connector_list
,
head
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
!
connector
->
encoder
||
connector
->
encoder
->
crtc
!=
crtc
)
...
...
drivers/gpu/drm/gma500/cdv_intel_dp.c
View file @
c9d49590
...
...
@@ -315,7 +315,7 @@ static int
cdv_intel_dp_mode_valid
(
struct
drm_connector
*
connector
,
struct
drm_display_mode
*
mode
)
{
struct
psb_intel_encoder
*
encoder
=
psb_intel
_attached_encoder
(
connector
);
struct
psb_intel_encoder
*
encoder
=
gma
_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
encoder
->
dev_priv
;
int
max_link_clock
=
cdv_intel_dp_link_clock
(
cdv_intel_dp_max_link_bw
(
encoder
));
int
max_lanes
=
cdv_intel_dp_max_lane_count
(
encoder
);
...
...
@@ -1532,7 +1532,7 @@ cdv_dp_detect(struct psb_intel_encoder *encoder)
static
enum
drm_connector_status
cdv_intel_dp_detect
(
struct
drm_connector
*
connector
,
bool
force
)
{
struct
psb_intel_encoder
*
encoder
=
psb_intel
_attached_encoder
(
connector
);
struct
psb_intel_encoder
*
encoder
=
gma
_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
encoder
->
dev_priv
;
enum
drm_connector_status
status
;
struct
edid
*
edid
=
NULL
;
...
...
@@ -1566,7 +1566,8 @@ cdv_intel_dp_detect(struct drm_connector *connector, bool force)
static
int
cdv_intel_dp_get_modes
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
intel_encoder
=
psb_intel_attached_encoder
(
connector
);
struct
psb_intel_encoder
*
intel_encoder
=
gma_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
intel_encoder
->
dev_priv
;
struct
edid
*
edid
=
NULL
;
int
ret
=
0
;
...
...
@@ -1622,7 +1623,7 @@ static int cdv_intel_dp_get_modes(struct drm_connector *connector)
static
bool
cdv_intel_dp_detect_audio
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
encoder
=
psb_intel
_attached_encoder
(
connector
);
struct
psb_intel_encoder
*
encoder
=
gma
_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
encoder
->
dev_priv
;
struct
edid
*
edid
;
bool
has_audio
=
false
;
...
...
@@ -1648,7 +1649,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,
uint64_t
val
)
{
struct
drm_psb_private
*
dev_priv
=
connector
->
dev
->
dev_private
;
struct
psb_intel_encoder
*
encoder
=
psb_intel
_attached_encoder
(
connector
);
struct
psb_intel_encoder
*
encoder
=
gma
_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
encoder
->
dev_priv
;
int
ret
;
...
...
@@ -1702,7 +1703,7 @@ static void
cdv_intel_dp_destroy
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
cdv_intel_dp
*
intel_dp
=
psb_intel_encoder
->
dev_priv
;
if
(
is_edp
(
psb_intel_encoder
))
{
...
...
@@ -1742,7 +1743,7 @@ static const struct drm_connector_funcs cdv_intel_dp_connector_funcs = {
static
const
struct
drm_connector_helper_funcs
cdv_intel_dp_connector_helper_funcs
=
{
.
get_modes
=
cdv_intel_dp_get_modes
,
.
mode_valid
=
cdv_intel_dp_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
const
struct
drm_encoder_funcs
cdv_intel_dp_enc_funcs
=
{
...
...
@@ -1828,7 +1829,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
drm_connector_init
(
dev
,
connector
,
&
cdv_intel_dp_connector_funcs
,
type
);
drm_encoder_init
(
dev
,
encoder
,
&
cdv_intel_dp_enc_funcs
,
DRM_MODE_ENCODER_TMDS
);
psb_intel
_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma
_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
if
(
type
==
DRM_MODE_CONNECTOR_DisplayPort
)
psb_intel_encoder
->
type
=
INTEL_OUTPUT_DISPLAYPORT
;
...
...
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
View file @
c9d49590
...
...
@@ -117,7 +117,7 @@ static void cdv_hdmi_save(struct drm_connector *connector)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
mid_intel_hdmi_priv
*
hdmi_priv
=
psb_intel_encoder
->
dev_priv
;
hdmi_priv
->
save_HDMIB
=
REG_READ
(
hdmi_priv
->
hdmi_reg
);
...
...
@@ -127,7 +127,7 @@ static void cdv_hdmi_restore(struct drm_connector *connector)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
mid_intel_hdmi_priv
*
hdmi_priv
=
psb_intel_encoder
->
dev_priv
;
REG_WRITE
(
hdmi_priv
->
hdmi_reg
,
hdmi_priv
->
save_HDMIB
);
...
...
@@ -138,7 +138,7 @@ static enum drm_connector_status cdv_hdmi_detect(
struct
drm_connector
*
connector
,
bool
force
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
mid_intel_hdmi_priv
*
hdmi_priv
=
psb_intel_encoder
->
dev_priv
;
struct
edid
*
edid
=
NULL
;
enum
drm_connector_status
status
=
connector_status_disconnected
;
...
...
@@ -222,7 +222,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
static
int
cdv_hdmi_get_modes
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
edid
*
edid
=
NULL
;
int
ret
=
0
;
...
...
@@ -257,7 +257,7 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
static
void
cdv_hdmi_destroy
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
psb_intel_encoder
->
i2c_bus
)
psb_intel_i2c_destroy
(
psb_intel_encoder
->
i2c_bus
);
...
...
@@ -269,16 +269,16 @@ static void cdv_hdmi_destroy(struct drm_connector *connector)
static
const
struct
drm_encoder_helper_funcs
cdv_hdmi_helper_funcs
=
{
.
dpms
=
cdv_hdmi_dpms
,
.
mode_fixup
=
cdv_hdmi_mode_fixup
,
.
prepare
=
psb_intel
_encoder_prepare
,
.
prepare
=
gma
_encoder_prepare
,
.
mode_set
=
cdv_hdmi_mode_set
,
.
commit
=
psb_intel
_encoder_commit
,
.
commit
=
gma
_encoder_commit
,
};
static
const
struct
drm_connector_helper_funcs
cdv_hdmi_connector_helper_funcs
=
{
.
get_modes
=
cdv_hdmi_get_modes
,
.
mode_valid
=
cdv_hdmi_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
const
struct
drm_connector_funcs
cdv_hdmi_connector_funcs
=
{
...
...
@@ -328,8 +328,7 @@ void cdv_hdmi_init(struct drm_device *dev,
drm_encoder_init
(
dev
,
encoder
,
&
psb_intel_lvds_enc_funcs
,
DRM_MODE_ENCODER_TMDS
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
psb_intel_encoder
->
type
=
INTEL_OUTPUT_HDMI
;
hdmi_priv
->
hdmi_reg
=
reg
;
hdmi_priv
->
has_hdmi_sink
=
false
;
...
...
drivers/gpu/drm/gma500/cdv_intel_lvds.c
View file @
c9d49590
...
...
@@ -408,7 +408,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_mode_device
*
mode_dev
=
&
dev_priv
->
mode_dev
;
int
ret
;
...
...
@@ -445,7 +445,7 @@ static int cdv_intel_lvds_get_modes(struct drm_connector *connector)
static
void
cdv_intel_lvds_destroy
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
psb_intel_encoder
->
i2c_bus
)
psb_intel_i2c_destroy
(
psb_intel_encoder
->
i2c_bus
);
...
...
@@ -529,7 +529,7 @@ static const struct drm_connector_helper_funcs
cdv_intel_lvds_connector_helper_funcs
=
{
.
get_modes
=
cdv_intel_lvds_get_modes
,
.
mode_valid
=
cdv_intel_lvds_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
const
struct
drm_connector_funcs
cdv_intel_lvds_connector_funcs
=
{
...
...
@@ -659,8 +659,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
DRM_MODE_ENCODER_LVDS
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
psb_intel_encoder
->
type
=
INTEL_OUTPUT_LVDS
;
drm_encoder_helper_add
(
encoder
,
&
cdv_intel_lvds_helper_funcs
);
...
...
drivers/gpu/drm/gma500/framebuffer.c
View file @
c9d49590
...
...
@@ -704,7 +704,7 @@ static void psb_setup_outputs(struct drm_device *dev)
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
drm_encoder
*
encoder
=
&
psb_intel_encoder
->
base
;
int
crtc_mask
=
0
,
clone_mask
=
0
;
...
...
drivers/gpu/drm/gma500/gma_display.c
View file @
c9d49590
...
...
@@ -38,7 +38,7 @@ bool gma_pipe_has_type(struct drm_crtc *crtc, int type)
list_for_each_entry
(
l_entry
,
&
mode_config
->
connector_list
,
head
)
{
if
(
l_entry
->
encoder
&&
l_entry
->
encoder
->
crtc
==
crtc
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
l_entry
);
gma
_attached_encoder
(
l_entry
);
if
(
psb_intel_encoder
->
type
==
type
)
return
true
;
}
...
...
@@ -547,7 +547,7 @@ void gma_encoder_destroy(struct drm_encoder *encoder)
struct
drm_encoder
*
gma_best_encoder
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
return
&
psb_intel_encoder
->
base
;
}
...
...
drivers/gpu/drm/gma500/mdfld_intel_display.c
View file @
c9d49590
...
...
@@ -747,7 +747,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
if
(
encoder
->
crtc
!=
crtc
)
continue
;
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
psb_intel_encoder
=
gma
_attached_encoder
(
connector
);
switch
(
psb_intel_encoder
->
type
)
{
case
INTEL_OUTPUT_MIPI
:
...
...
drivers/gpu/drm/gma500/oaktrail_crtc.c
View file @
c9d49590
...
...
@@ -324,7 +324,7 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,
if
(
!
connector
->
encoder
||
connector
->
encoder
->
crtc
!=
crtc
)
continue
;
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
psb_intel_encoder
=
gma
_attached_encoder
(
connector
);
switch
(
psb_intel_encoder
->
type
)
{
case
INTEL_OUTPUT_LVDS
:
...
...
drivers/gpu/drm/gma500/oaktrail_hdmi.c
View file @
c9d49590
...
...
@@ -609,16 +609,16 @@ static void oaktrail_hdmi_destroy(struct drm_connector *connector)
static
const
struct
drm_encoder_helper_funcs
oaktrail_hdmi_helper_funcs
=
{
.
dpms
=
oaktrail_hdmi_dpms
,
.
mode_fixup
=
oaktrail_hdmi_mode_fixup
,
.
prepare
=
psb_intel
_encoder_prepare
,
.
prepare
=
gma
_encoder_prepare
,
.
mode_set
=
oaktrail_hdmi_mode_set
,
.
commit
=
psb_intel
_encoder_commit
,
.
commit
=
gma
_encoder_commit
,
};
static
const
struct
drm_connector_helper_funcs
oaktrail_hdmi_connector_helper_funcs
=
{
.
get_modes
=
oaktrail_hdmi_get_modes
,
.
mode_valid
=
oaktrail_hdmi_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
const
struct
drm_connector_funcs
oaktrail_hdmi_connector_funcs
=
{
...
...
@@ -663,8 +663,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
&
oaktrail_hdmi_enc_funcs
,
DRM_MODE_ENCODER_TMDS
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
psb_intel_encoder
->
type
=
INTEL_OUTPUT_HDMI
;
drm_encoder_helper_add
(
encoder
,
&
oaktrail_hdmi_helper_funcs
);
...
...
drivers/gpu/drm/gma500/oaktrail_lvds.c
View file @
c9d49590
...
...
@@ -352,8 +352,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
drm_encoder_init
(
dev
,
encoder
,
&
psb_intel_lvds_enc_funcs
,
DRM_MODE_ENCODER_LVDS
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
psb_intel_encoder
->
type
=
INTEL_OUTPUT_LVDS
;
drm_encoder_helper_add
(
encoder
,
&
oaktrail_lvds_helper_funcs
);
...
...
drivers/gpu/drm/gma500/psb_drv.c
View file @
c9d49590
...
...
@@ -372,7 +372,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long chipset)
/* Only add backlight support if we have LVDS output */
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
psb_intel_encoder
=
gma
_attached_encoder
(
connector
);
switch
(
psb_intel_encoder
->
type
)
{
case
INTEL_OUTPUT_LVDS
:
...
...
drivers/gpu/drm/gma500/psb_intel_display.c
View file @
c9d49590
...
...
@@ -82,30 +82,6 @@ static void psb_intel_clock(int refclk, struct gma_clock_t *clock)
clock
->
dot
=
clock
->
vco
/
clock
->
p
;
}
void
psb_intel_encoder_prepare
(
struct
drm_encoder
*
encoder
)
{
struct
drm_encoder_helper_funcs
*
encoder_funcs
=
encoder
->
helper_private
;
/* lvds has its own version of prepare see psb_intel_lvds_prepare */
encoder_funcs
->
dpms
(
encoder
,
DRM_MODE_DPMS_OFF
);
}
void
psb_intel_encoder_commit
(
struct
drm_encoder
*
encoder
)
{
struct
drm_encoder_helper_funcs
*
encoder_funcs
=
encoder
->
helper_private
;
/* lvds has its own version of commit see psb_intel_lvds_commit */
encoder_funcs
->
dpms
(
encoder
,
DRM_MODE_DPMS_ON
);
}
void
psb_intel_encoder_destroy
(
struct
drm_encoder
*
encoder
)
{
struct
psb_intel_encoder
*
intel_encoder
=
to_psb_intel_encoder
(
encoder
);
drm_encoder_cleanup
(
encoder
);
kfree
(
intel_encoder
);
}
/**
* Return the pipe currently connected to the panel fitter,
* or -1 if the panel fitter is not present or not in use
...
...
@@ -152,7 +128,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,
list_for_each_entry
(
connector
,
&
mode_config
->
connector_list
,
head
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
!
connector
->
encoder
||
connector
->
encoder
->
crtc
!=
crtc
)
...
...
@@ -752,29 +728,10 @@ int psb_intel_connector_clones(struct drm_device *dev, int type_mask)
list_for_each_entry
(
connector
,
&
dev
->
mode_config
.
connector_list
,
head
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
if
(
type_mask
&
(
1
<<
psb_intel_encoder
->
type
))
index_mask
|=
(
1
<<
entry
);
entry
++
;
}
return
index_mask
;
}
/* current intel driver doesn't take advantage of encoders
always give back the encoder for the connector
*/
struct
drm_encoder
*
psb_intel_best_encoder
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel_attached_encoder
(
connector
);
return
&
psb_intel_encoder
->
base
;
}
void
psb_intel_connector_attach_encoder
(
struct
psb_intel_connector
*
connector
,
struct
psb_intel_encoder
*
encoder
)
{
connector
->
encoder
=
encoder
;
drm_mode_connector_attach_encoder
(
&
connector
->
base
,
&
encoder
->
base
);
}
drivers/gpu/drm/gma500/psb_intel_drv.h
View file @
c9d49590
...
...
@@ -226,33 +226,16 @@ extern void oaktrail_dsi_init(struct drm_device *dev,
extern
void
mid_dsi_init
(
struct
drm_device
*
dev
,
struct
psb_intel_mode_device
*
mode_dev
,
int
dsi_num
);
extern
void
psb_intel_encoder_prepare
(
struct
drm_encoder
*
encoder
);
extern
void
psb_intel_encoder_commit
(
struct
drm_encoder
*
encoder
);
extern
void
psb_intel_encoder_destroy
(
struct
drm_encoder
*
encoder
);
extern
struct
drm_encoder
*
gma_best_encoder
(
struct
drm_connector
*
connector
);
extern
void
gma_connector_attach_encoder
(
struct
psb_intel_connector
*
connector
,
struct
psb_intel_encoder
*
encoder
);
static
inline
struct
psb_intel_encoder
*
psb_intel_attached_encoder
(
struct
drm_connector
*
connector
)
{
return
to_psb_intel_connector
(
connector
)
->
encoder
;
}
static
inline
struct
psb_intel_encoder
*
gma_attached_encoder
(
struct
drm_connector
*
connector
)
{
return
to_psb_intel_connector
(
connector
)
->
encoder
;
}
extern
void
psb_intel_connector_attach_encoder
(
struct
psb_intel_connector
*
connector
,
struct
psb_intel_encoder
*
encoder
);
extern
struct
drm_encoder
*
psb_intel_best_encoder
(
struct
drm_connector
*
connector
);
extern
struct
drm_display_mode
*
psb_intel_crtc_mode_get
(
struct
drm_device
*
dev
,
struct
drm_crtc
*
crtc
);
extern
int
psb_intel_get_pipe_from_crtc_id
(
struct
drm_device
*
dev
,
void
*
data
,
...
...
drivers/gpu/drm/gma500/psb_intel_lvds.c
View file @
c9d49590
...
...
@@ -268,7 +268,7 @@ static void psb_intel_lvds_save(struct drm_connector *connector)
struct
drm_psb_private
*
dev_priv
=
(
struct
drm_psb_private
*
)
dev
->
dev_private
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_lvds_priv
*
lvds_priv
=
(
struct
psb_intel_lvds_priv
*
)
psb_intel_encoder
->
dev_priv
;
...
...
@@ -308,7 +308,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector)
struct
drm_device
*
dev
=
connector
->
dev
;
u32
pp_status
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_lvds_priv
*
lvds_priv
=
(
struct
psb_intel_lvds_priv
*
)
psb_intel_encoder
->
dev_priv
;
...
...
@@ -350,7 +350,7 @@ int psb_intel_lvds_mode_valid(struct drm_connector *connector,
{
struct
drm_psb_private
*
dev_priv
=
connector
->
dev
->
dev_private
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
drm_display_mode
*
fixed_mode
=
dev_priv
->
mode_dev
.
panel_fixed_mode
;
...
...
@@ -526,7 +526,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
struct
psb_intel_mode_device
*
mode_dev
=
&
dev_priv
->
mode_dev
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_lvds_priv
*
lvds_priv
=
psb_intel_encoder
->
dev_priv
;
int
ret
=
0
;
...
...
@@ -565,7 +565,7 @@ static int psb_intel_lvds_get_modes(struct drm_connector *connector)
void
psb_intel_lvds_destroy
(
struct
drm_connector
*
connector
)
{
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_lvds_priv
*
lvds_priv
=
psb_intel_encoder
->
dev_priv
;
if
(
lvds_priv
->
ddc_bus
)
...
...
@@ -656,7 +656,7 @@ const struct drm_connector_helper_funcs
psb_intel_lvds_connector_helper_funcs
=
{
.
get_modes
=
psb_intel_lvds_get_modes
,
.
mode_valid
=
psb_intel_lvds_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
const
struct
drm_connector_funcs
psb_intel_lvds_connector_funcs
=
{
...
...
@@ -734,8 +734,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
&
psb_intel_lvds_enc_funcs
,
DRM_MODE_ENCODER_LVDS
);
psb_intel_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
gma_connector_attach_encoder
(
psb_intel_connector
,
psb_intel_encoder
);
psb_intel_encoder
->
type
=
INTEL_OUTPUT_LVDS
;
drm_encoder_helper_add
(
encoder
,
&
psb_intel_lvds_helper_funcs
);
...
...
drivers/gpu/drm/gma500/psb_intel_sdvo.c
View file @
c9d49590
...
...
@@ -200,7 +200,7 @@ static struct psb_intel_sdvo *to_psb_intel_sdvo(struct drm_encoder *encoder)
static
struct
psb_intel_sdvo
*
intel_attached_sdvo
(
struct
drm_connector
*
connector
)
{
return
container_of
(
psb_intel
_attached_encoder
(
connector
),
return
container_of
(
gma
_attached_encoder
(
connector
),
struct
psb_intel_sdvo
,
base
);
}
...
...
@@ -1837,7 +1837,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
psb_intel_encoder
*
psb_intel_encoder
=
psb_intel
_attached_encoder
(
connector
);
gma
_attached_encoder
(
connector
);
struct
psb_intel_sdvo
*
sdvo
=
to_psb_intel_sdvo
(
&
psb_intel_encoder
->
base
);
...
...
@@ -1847,8 +1847,7 @@ static void psb_intel_sdvo_save(struct drm_connector *connector)
static
void
psb_intel_sdvo_restore
(
struct
drm_connector
*
connector
)
{
struct
drm_device
*
dev
=
connector
->
dev
;
struct
drm_encoder
*
encoder
=
&
psb_intel_attached_encoder
(
connector
)
->
base
;
struct
drm_encoder
*
encoder
=
&
gma_attached_encoder
(
connector
)
->
base
;
struct
psb_intel_sdvo
*
sdvo
=
to_psb_intel_sdvo
(
encoder
);
struct
drm_crtc
*
crtc
=
encoder
->
crtc
;
...
...
@@ -1864,9 +1863,9 @@ static void psb_intel_sdvo_restore(struct drm_connector *connector)
static
const
struct
drm_encoder_helper_funcs
psb_intel_sdvo_helper_funcs
=
{
.
dpms
=
psb_intel_sdvo_dpms
,
.
mode_fixup
=
psb_intel_sdvo_mode_fixup
,
.
prepare
=
psb_intel
_encoder_prepare
,
.
prepare
=
gma
_encoder_prepare
,
.
mode_set
=
psb_intel_sdvo_mode_set
,
.
commit
=
psb_intel
_encoder_commit
,
.
commit
=
gma
_encoder_commit
,
};
static
const
struct
drm_connector_funcs
psb_intel_sdvo_connector_funcs
=
{
...
...
@@ -1882,7 +1881,7 @@ static const struct drm_connector_funcs psb_intel_sdvo_connector_funcs = {
static
const
struct
drm_connector_helper_funcs
psb_intel_sdvo_connector_helper_funcs
=
{
.
get_modes
=
psb_intel_sdvo_get_modes
,
.
mode_valid
=
psb_intel_sdvo_mode_valid
,
.
best_encoder
=
psb_intel
_best_encoder
,
.
best_encoder
=
gma
_best_encoder
,
};
static
void
psb_intel_sdvo_enc_destroy
(
struct
drm_encoder
*
encoder
)
...
...
@@ -1894,7 +1893,7 @@ static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder)
psb_intel_sdvo
->
sdvo_lvds_fixed_mode
);
i2c_del_adapter
(
&
psb_intel_sdvo
->
ddc
);
psb_intel
_encoder_destroy
(
encoder
);
gma
_encoder_destroy
(
encoder
);
}
static
const
struct
drm_encoder_funcs
psb_intel_sdvo_enc_funcs
=
{
...
...
@@ -2055,7 +2054,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
connector
->
base
.
base
.
doublescan_allowed
=
0
;
connector
->
base
.
base
.
display_info
.
subpixel_order
=
SubPixelHorizontalRGB
;
psb_intel
_connector_attach_encoder
(
&
connector
->
base
,
&
encoder
->
base
);
gma
_connector_attach_encoder
(
&
connector
->
base
,
&
encoder
->
base
);
drm_sysfs_connector_add
(
&
connector
->
base
.
base
);
}
...
...
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