Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209714
b: refs/heads/master
c: 4003975
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson authored and Eric Anholt committed Aug 9, 2010
1 parent 76ecef8 commit 0c87939
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32aad86fe88e7323d4fc5e9e423abcee0d55a03d
refs/heads/master: 400397506f96466a7f57911b33b4b9c075880994
34 changes: 11 additions & 23 deletions trunk/drivers/gpu/drm/i915/intel_sdvo.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct intel_sdvo {
bool is_tv;

/* This is for current tv format name */
char *tv_format_name;
int tv_format_index;

/**
* This is set if we treat the device as HDMI, instead of DVI.
Expand Down Expand Up @@ -141,7 +141,7 @@ struct intel_sdvo_connector {
uint16_t output_flag;

/* This contains all current supported TV format */
char *tv_format_supported[TV_FORMAT_NUM];
u8 tv_format_supported[TV_FORMAT_NUM];
int format_supported_num;
struct drm_property *tv_format_property;
struct drm_property *tv_format_name_property[TV_FORMAT_NUM];
Expand Down Expand Up @@ -958,13 +958,9 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
{
struct intel_sdvo_tv_format format;
uint32_t format_map, i;

for (i = 0; i < TV_FORMAT_NUM; i++)
if (tv_format_names[i] == intel_sdvo->tv_format_name)
break;
uint32_t format_map;

format_map = 1 << i;
format_map = 1 << intel_sdvo->tv_format_index;
memset(&format, 0, sizeof(format));
memcpy(&format, &format_map, min(sizeof(format), sizeof(format_map)));

Expand Down Expand Up @@ -1614,11 +1610,7 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
/* Read the list of supported input resolutions for the selected TV
* format.
*/
for (i = 0; i < TV_FORMAT_NUM; i++)
if (tv_format_names[i] == intel_sdvo->tv_format_name)
break;

format_map = (1 << i);
format_map = 1 << intel_sdvo->tv_format_index;
memcpy(&tv_res, &format_map,
min(sizeof(format_map), sizeof(struct intel_sdvo_sdtv_resolution_request)));

Expand All @@ -1640,7 +1632,6 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
if (nmode)
drm_mode_probed_add(connector, nmode);
}

}

static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
Expand Down Expand Up @@ -1768,11 +1759,11 @@ intel_sdvo_set_property(struct drm_connector *connector,
if (val >= TV_FORMAT_NUM)
return -EINVAL;

if (intel_sdvo->tv_format_name ==
if (intel_sdvo->tv_format_index ==
intel_sdvo_connector->tv_format_supported[val])
return 0;

intel_sdvo->tv_format_name = intel_sdvo_connector->tv_format_supported[val];
intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[val];
changed = true;
} else if (IS_TV_OR_LVDS(intel_sdvo_connector)) {
cmd = 0;
Expand Down Expand Up @@ -2271,11 +2262,8 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,

intel_sdvo_connector->format_supported_num = 0;
for (i = 0 ; i < TV_FORMAT_NUM; i++)
if (format_map & (1 << i)) {
intel_sdvo_connector->tv_format_supported
[intel_sdvo_connector->format_supported_num++] =
tv_format_names[i];
}
if (format_map & (1 << i))
intel_sdvo_connector->tv_format_supported[intel_sdvo_connector->format_supported_num++] = i;


intel_sdvo_connector->tv_format_property =
Expand All @@ -2285,9 +2273,9 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
for (i = 0; i < intel_sdvo_connector->format_supported_num; i++)
drm_property_add_enum(
intel_sdvo_connector->tv_format_property, i,
i, intel_sdvo_connector->tv_format_supported[i]);
i, tv_format_names[intel_sdvo_connector->tv_format_supported[i]]);

intel_sdvo->tv_format_name = intel_sdvo_connector->tv_format_supported[0];
intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[0];
drm_connector_attach_property(&intel_sdvo_connector->base.base,
intel_sdvo_connector->tv_format_property, 0);
return true;
Expand Down

0 comments on commit 0c87939

Please sign in to comment.