Skip to contentSkip to conversation

drm/ast: Fix mclk calculation

PATCH New Benjamin Herrenschmidt 1 participant 1 message Feb 16, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ast: Fix mclk calculation

The very large values observed were the result of a bug in the calculation. Y.C. Chen gave me the right formula so here is a patch fixing it.

Thankfully nothing seem to use that unless you try to POST the chip.

--

drivers/gpu/drm/ast/ast_main.c +1 -1
index 60f23cc..3b87877 100644
@@ -350,7 +350,7 @@ static int ast_get_dram_info(struct drm_device *dev)
 		div = 0x1;
 		break;
 	}
-	ast->mclk = ref_pll * (num + 2) / (denum + 2) * (div * 1000);
+	ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000));
 	return 0;
 }
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel