dp common: Build Fix, use get_pixel_size_for.

* Thanks DeadYak for the tip
This commit is contained in:
Alexander von Gluck IV
2012-04-06 15:11:33 -05:00
parent 19574417cb
commit 9e4967aa9d
+10 -12
View File
@@ -62,20 +62,18 @@ dp_decode_link_rate(uint32 rawLinkRate)
uint32 uint32
dp_get_lane_count(dp_info* dpInfo, display_mode* mode) dp_get_lane_count(dp_info* dpInfo, display_mode* mode)
{ {
// TODO: Really need a function in GraphicDefs.h for this size_t pixelChunk;
uint32 bitsPerPixel; size_t pixelsPerChunk;
switch (mode->space) { status_t result = get_pixel_size_for((color_space)mode->space, &pixelChunk,
case B_CMAP8: NULL, &pixelsPerChunk);
bitsPerPixel = 8;
case B_RGB15_LITTLE: if (result != B_OK) {
bitsPerPixel = 15; TRACE("%s: Invalid color space!\n", __func__);
case B_RGB16_LITTLE: return 0;
bitsPerPixel = 16;
case B_RGB24_LITTLE:
case B_RGB32_LITTLE:
bitsPerPixel = 32;
} }
uint32 bitsPerPixel = (pixelChunk / pixelsPerChunk) * 8;
uint32 maxLaneCount = dpInfo->config[DP_MAX_LANE_COUNT] uint32 maxLaneCount = dpInfo->config[DP_MAX_LANE_COUNT]
& DP_MAX_LANE_COUNT_MASK; & DP_MAX_LANE_COUNT_MASK;
uint32 maxLinkRate = dp_decode_link_rate(dpInfo->config[DP_MAX_LINK_RATE]); uint32 maxLinkRate = dp_decode_link_rate(dpInfo->config[DP_MAX_LINK_RATE]);